From 8d64a94d83e023e422fda40b2c0cbd0723283026 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Fri, 11 Jul 2025 10:41:33 -0400 Subject: [PATCH] Handle rm failure in uninstall --- README.md | 1 + docs/docs/content/index.md | 1 + scripts/uninstall.sh | 9 ++++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0ed38ec..598bf03 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,7 @@ Run the matching uninstaller if you need to remove a previous installation or cl ```bash bash -c "$(curl -sSL https://raw.githubusercontent.com/PR0M3TH3AN/SeedPass/main/scripts/uninstall.sh)" ``` +If you see a warning that an old executable couldn't be removed, delete the file manually. **Windows (PowerShell):** ```powershell diff --git a/docs/docs/content/index.md b/docs/docs/content/index.md index 81aaab2..345b1fa 100644 --- a/docs/docs/content/index.md +++ b/docs/docs/content/index.md @@ -102,6 +102,7 @@ Run the matching uninstaller if you need to remove a previous installation or cl ```bash bash -c "$(curl -sSL https://raw.githubusercontent.com/PR0M3TH3AN/SeedPass/main/scripts/uninstall.sh)" ``` +If the script warns that it couldn't remove an executable, delete that file manually. **Windows (PowerShell):** ```powershell diff --git a/scripts/uninstall.sh b/scripts/uninstall.sh index 6a02d4c..45c24b0 100644 --- a/scripts/uninstall.sh +++ b/scripts/uninstall.sh @@ -22,7 +22,14 @@ remove_stale_executables() { candidate="$dir/seedpass" if [ -f "$candidate" ] && [ "$candidate" != "$LAUNCHER_PATH" ]; then print_info "Removing old executable '$candidate'..." - rm -f "$candidate" || true + if rm -f "$candidate"; then + rm_status=0 + else + rm_status=$? + fi + if [ $rm_status -ne 0 ] && [ -f "$candidate" ]; then + print_warning "Failed to remove $candidate – try deleting it manually" + fi fi done }