Handle rm failure in uninstall

This commit is contained in:
thePR0M3TH3AN
2025-07-11 10:41:33 -04:00
parent 8a70b65e02
commit 8d64a94d83
3 changed files with 10 additions and 1 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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
}