mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-07 14:58:56 +00:00
Merge pull request #455 from PR0M3TH3AN/codex/fix-404-error-in-uninstall-script
Improve uninstall script
This commit is contained in:
@@ -15,6 +15,18 @@ print_success() { echo -e "\033[1;32m[SUCCESS]\033[0m $1"; }
|
|||||||
print_warning() { echo -e "\033[1;33m[WARNING]\033[0m $1"; }
|
print_warning() { echo -e "\033[1;33m[WARNING]\033[0m $1"; }
|
||||||
print_error() { echo -e "\033[1;31m[ERROR]\033[0m $1"; }
|
print_error() { echo -e "\033[1;31m[ERROR]\033[0m $1"; }
|
||||||
|
|
||||||
|
# Remove any stale 'seedpass' executables that may still be on the PATH.
|
||||||
|
remove_stale_executables() {
|
||||||
|
IFS=':' read -ra DIRS <<< "$PATH"
|
||||||
|
for dir in "${DIRS[@]}"; do
|
||||||
|
candidate="$dir/seedpass"
|
||||||
|
if [ -f "$candidate" ] && [ "$candidate" != "$LAUNCHER_PATH" ]; then
|
||||||
|
print_info "Removing old executable '$candidate'..."
|
||||||
|
rm -f "$candidate" || true
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
if [ -d "$INSTALL_DIR" ]; then
|
if [ -d "$INSTALL_DIR" ]; then
|
||||||
print_info "Removing installation directory '$INSTALL_DIR'..."
|
print_info "Removing installation directory '$INSTALL_DIR'..."
|
||||||
@@ -23,6 +35,7 @@ main() {
|
|||||||
print_info "Installation directory not found."
|
print_info "Installation directory not found."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ -f "$LAUNCHER_PATH" ]; then
|
if [ -f "$LAUNCHER_PATH" ]; then
|
||||||
print_info "Removing launcher script '$LAUNCHER_PATH'..."
|
print_info "Removing launcher script '$LAUNCHER_PATH'..."
|
||||||
rm -f "$LAUNCHER_PATH"
|
rm -f "$LAUNCHER_PATH"
|
||||||
@@ -30,11 +43,16 @@ main() {
|
|||||||
print_info "Launcher script not found."
|
print_info "Launcher script not found."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
remove_stale_executables
|
||||||
|
|
||||||
print_info "Attempting to uninstall any global 'seedpass' package with pip..."
|
print_info "Attempting to uninstall any global 'seedpass' package with pip..."
|
||||||
if command -v pip &> /dev/null; then
|
if command -v python3 &> /dev/null; then
|
||||||
|
python3 -m pip uninstall -y seedpass >/dev/null 2>&1 || true
|
||||||
|
elif command -v pip &> /dev/null; then
|
||||||
pip uninstall -y seedpass >/dev/null 2>&1 || true
|
pip uninstall -y seedpass >/dev/null 2>&1 || true
|
||||||
elif command -v pip3 &> /dev/null; then
|
fi
|
||||||
pip3 uninstall -y seedpass >/dev/null 2>&1 || true
|
if command -v pipx &> /dev/null; then
|
||||||
|
pipx uninstall -y seedpass >/dev/null 2>&1 || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
print_success "SeedPass uninstalled."
|
print_success "SeedPass uninstalled."
|
||||||
|
Reference in New Issue
Block a user