From 41bab9d16da8554bdb994f51f196bbba042863b9 Mon Sep 17 00:00:00 2001 From: Kroese Date: Fri, 16 Feb 2024 14:43:03 +0100 Subject: [PATCH] fix: Shellcheck (#173) --- src/install.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/install.sh b/src/install.sh index 911a547..0b3a910 100644 --- a/src/install.sh +++ b/src/install.sh @@ -651,7 +651,8 @@ detectImage() { return 0 fi - local src=$(find "$dir" -maxdepth 1 -type d -iname sources | head -n 1) + local src loc tag result name name2 desc + src=$(find "$dir" -maxdepth 1 -type d -iname sources | head -n 1) if [ ! -d "$src" ]; then warn "failed to locate 'sources' folder in ISO image, $FB" @@ -659,8 +660,7 @@ detectImage() { return 1 fi - local tag result name name2 desc - local loc=$(find "$src" -maxdepth 1 -type f -iname install.wim | head -n 1) + loc=$(find "$src" -maxdepth 1 -type f -iname install.wim | head -n 1) [ ! -f "$loc" ] && loc=$(find "$src" -maxdepth 1 -type f -iname install.esd | head -n 1) if [ ! -f "$loc" ]; then @@ -892,14 +892,14 @@ updateImage() { local iso="$1" local dir="$2" local asset="/run/assets/$3" - local index result + local path src loc index result [ ! -f "$asset" ] && return 0 - local path=$(find "$dir" -maxdepth 1 -type f -iname autounattend.xml | head -n 1) + path=$(find "$dir" -maxdepth 1 -type f -iname autounattend.xml | head -n 1) [ -n "$path" ] && cp "$asset" "$path" - local src=$(find "$dir" -maxdepth 1 -type d -iname sources | head -n 1) + src=$(find "$dir" -maxdepth 1 -type d -iname sources | head -n 1) if [ ! -d "$src" ]; then warn "failed to locate 'sources' folder in ISO image, $FB" @@ -907,7 +907,7 @@ updateImage() { return 1 fi - local loc=$(find "$src" -maxdepth 1 -type f -iname boot.wim | head -n 1) + loc=$(find "$src" -maxdepth 1 -type f -iname boot.wim | head -n 1) [ ! -f "$loc" ] && loc=$(find "$src" -maxdepth 1 -type f -iname boot.esd | head -n 1) if [ ! -f "$loc" ]; then