From 9126baa6996102690f752b7c16c50c055422fe97 Mon Sep 17 00:00:00 2001 From: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com> Date: Thu, 30 May 2024 10:14:35 +0000 Subject: [PATCH 1/9] fix: don't quote $SUDO --- installer.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/installer.sh b/installer.sh index 845a435..2eb0b6d 100755 --- a/installer.sh +++ b/installer.sh @@ -282,27 +282,27 @@ function waUninstallUser() { grep -l -d skip "bin/winapps" "$HOME/.local/share/applications/"* -s | while IFS= read -r F do echo -n " Removing $F..." - "$SUDO" rm "$F" + $SUDO rm "$F" echo " Finished." done grep -l -d skip "bin/winapps" "$HOME/.local/bin/"* -s | while IFS= read -r F do echo -n " Removing $F..." - "$SUDO" rm "$F" + $SUDO rm "$F" echo " Finished." done } function waUninstallSystem() { - "$SUDO" rm -f "/usr/local/bin/winapps" - "$SUDO" rm -rf "/usr/local/share/winapps" + $SUDO rm -f "/usr/local/bin/winapps" + $SUDO rm -rf "/usr/local/share/winapps" grep -l -d skip "bin/winapps" "/usr/share/applications/"* -s | while IFS= read -r F do if [ -z "$SUDO" ]; then waNoSudo fi echo -n " Removing $F..." - "$SUDO" rm "$F" + $SUDO rm "$F" echo " Finished." done grep -l -d skip "bin/winapps" "/usr/local/bin/"* -s | while IFS= read -r F @@ -311,7 +311,7 @@ function waUninstallSystem() { waNoSudo fi echo -n " Removing $F..." - "$SUDO" rm "$F" + $SUDO rm "$F" echo " Finished." done } From 109cbf5f793ab700e8c2a9c2754edc0cb5441cfc Mon Sep 17 00:00:00 2001 From: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com> Date: Thu, 30 May 2024 10:16:11 +0000 Subject: [PATCH 2/9] fix: actually use loop var --- installer.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/installer.sh b/installer.sh index 2eb0b6d..6e536d9 100755 --- a/installer.sh +++ b/installer.sh @@ -42,12 +42,10 @@ function waFindInstalled() { rm -f "$HOME/.local/share/winapps/installed" rm -f "$HOME/.local/share/winapps/detected" cp "$DIR/install/ExtractPrograms.ps1" "$HOME/.local/share/winapps/ExtractPrograms.ps1" - # FIXME - # shellcheck disable=SC2066 for F in "$DIR/apps"; do [[ -e "$F" ]] || break # shellcheck disable=SC1090 - . "$DIR/apps/$F/info" + . "$F/info" printf "IF EXIST \"%s\" ECHO %s >> \\\\tsclient\\home\\.local\\share\\winapps\\installed.tmp" "$WIN_EXECUTABLE" "$F" >>"$HOME/.local/share/winapps/installed.bat" done printf "powershell.exe -ExecutionPolicy Bypass -File \\\\tsclient\\home\\.local\\share\\winapps\\ExtractPrograms.ps1 > \\\\tsclient\home\\.local\\share\\winapps\\detected" >>"$HOME/.local/share/winapps/installed.bat" From f773560ca80c68b1f0f5a1a5b0877927dbf18b7a Mon Sep 17 00:00:00 2001 From: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com> Date: Thu, 30 May 2024 10:20:55 +0000 Subject: [PATCH 3/9] fix: fix SC2066; do not quote this --- installer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer.sh b/installer.sh index 6e536d9..1ec9d45 100755 --- a/installer.sh +++ b/installer.sh @@ -42,7 +42,7 @@ function waFindInstalled() { rm -f "$HOME/.local/share/winapps/installed" rm -f "$HOME/.local/share/winapps/detected" cp "$DIR/install/ExtractPrograms.ps1" "$HOME/.local/share/winapps/ExtractPrograms.ps1" - for F in "$DIR/apps"; do + for F in $DIR/apps; do [[ -e "$F" ]] || break # shellcheck disable=SC1090 . "$F/info" From eb4176987a3c3528b63897e156b8c05893223374 Mon Sep 17 00:00:00 2001 From: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com> Date: Thu, 30 May 2024 10:21:34 +0000 Subject: [PATCH 4/9] fix: do not disable shellcheck errors annotated with FIXME --- installer.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/installer.sh b/installer.sh index 1ec9d45..89d6ab4 100755 --- a/installer.sh +++ b/installer.sh @@ -122,9 +122,8 @@ function waConfigureApps() { APPS+=("$FULL_NAME ($F)") INSTALLED_EXES+=("$(echo "${WIN_EXECUTABLE##*\\}" | tr '[:upper:]' '[:lower:]')") done < <(sed 's/\r/\n/g' < "$HOME/.local/share/winapps/installed") - # FIXME - # shellcheck disable=SC2207,SC2031 - IFS=$'\n' APPS=($(sort <<<"${APPS[*]}")) + IFS=$'\n' + APPS=($(sort <<<"${APPS[*]}")) unset IFS OPTIONS=("Set up all detected pre-configured applications" "Select which pre-configured applications to set up" "Do not set up any pre-configured applications") From a80e951e40e7e702b76174e97067cfab0d496d96 Mon Sep 17 00:00:00 2001 From: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com> Date: Thu, 30 May 2024 10:24:26 +0000 Subject: [PATCH 5/9] fix: this is just a warning, we can ignore it for now --- installer.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/installer.sh b/installer.sh index 89d6ab4..c73ab24 100755 --- a/installer.sh +++ b/installer.sh @@ -123,6 +123,7 @@ function waConfigureApps() { INSTALLED_EXES+=("$(echo "${WIN_EXECUTABLE##*\\}" | tr '[:upper:]' '[:lower:]')") done < <(sed 's/\r/\n/g' < "$HOME/.local/share/winapps/installed") IFS=$'\n' + # shellcheck disable=SC2207 APPS=($(sort <<<"${APPS[*]}")) unset IFS OPTIONS=("Set up all detected pre-configured applications" "Select which pre-configured applications to set up" "Do not set up any pre-configured applications") From 662378aefeb8aa045db12472a6a24168ca097f32 Mon Sep 17 00:00:00 2001 From: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com> Date: Thu, 30 May 2024 10:26:48 +0000 Subject: [PATCH 6/9] fix: ignore shellcheck info --- installer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer.sh b/installer.sh index c73ab24..d76b39e 100755 --- a/installer.sh +++ b/installer.sh @@ -44,7 +44,7 @@ function waFindInstalled() { cp "$DIR/install/ExtractPrograms.ps1" "$HOME/.local/share/winapps/ExtractPrograms.ps1" for F in $DIR/apps; do [[ -e "$F" ]] || break - # shellcheck disable=SC1090 + # shellcheck disable=SC1090,SC1091 . "$F/info" printf "IF EXIST \"%s\" ECHO %s >> \\\\tsclient\\home\\.local\\share\\winapps\\installed.tmp" "$WIN_EXECUTABLE" "$F" >>"$HOME/.local/share/winapps/installed.bat" done From 7abfef3477831977e824c66dcaaf62c66797a879 Mon Sep 17 00:00:00 2001 From: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com> Date: Thu, 30 May 2024 12:09:16 +0000 Subject: [PATCH 7/9] fix: don't remove fixme --- installer.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/installer.sh b/installer.sh index d76b39e..cdaa74c 100755 --- a/installer.sh +++ b/installer.sh @@ -123,6 +123,7 @@ function waConfigureApps() { INSTALLED_EXES+=("$(echo "${WIN_EXECUTABLE##*\\}" | tr '[:upper:]' '[:lower:]')") done < <(sed 's/\r/\n/g' < "$HOME/.local/share/winapps/installed") IFS=$'\n' + # FIXME # shellcheck disable=SC2207 APPS=($(sort <<<"${APPS[*]}")) unset IFS From 0ea4b865ddbc0cbd227bc141e256e155246c48d2 Mon Sep 17 00:00:00 2001 From: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com> Date: Thu, 30 May 2024 12:10:18 +0000 Subject: [PATCH 8/9] fix: actually use glob pattern so the loop works --- installer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer.sh b/installer.sh index cdaa74c..3cfe27f 100755 --- a/installer.sh +++ b/installer.sh @@ -42,7 +42,7 @@ function waFindInstalled() { rm -f "$HOME/.local/share/winapps/installed" rm -f "$HOME/.local/share/winapps/detected" cp "$DIR/install/ExtractPrograms.ps1" "$HOME/.local/share/winapps/ExtractPrograms.ps1" - for F in $DIR/apps; do + for F in $DIR/apps/*; do [[ -e "$F" ]] || break # shellcheck disable=SC1090,SC1091 . "$F/info" From 2e7dea1cce27f0ed5ee23dd7a6a83abd979db27b Mon Sep 17 00:00:00 2001 From: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com> Date: Thu, 30 May 2024 12:14:13 +0000 Subject: [PATCH 9/9] fix: fix shellcheck error --- installer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer.sh b/installer.sh index 3cfe27f..3784a6c 100755 --- a/installer.sh +++ b/installer.sh @@ -42,7 +42,7 @@ function waFindInstalled() { rm -f "$HOME/.local/share/winapps/installed" rm -f "$HOME/.local/share/winapps/detected" cp "$DIR/install/ExtractPrograms.ps1" "$HOME/.local/share/winapps/ExtractPrograms.ps1" - for F in $DIR/apps/*; do + for F in "$DIR"/apps/*; do [[ -e "$F" ]] || break # shellcheck disable=SC1090,SC1091 . "$F/info"