Refactor container build and installation pipeline to use configurable Makefile parameters (e.g. DISTROS, base images) and propagate them through all build, install, and test scripts
This commit is contained in:
34
scripts/uninstall.sh
Executable file
34
scripts/uninstall.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
echo "[uninstall] Starting pkgmgr uninstall..."
|
||||
|
||||
VENV_DIR="${HOME}/.venvs/pkgmgr"
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# Remove virtual environment
|
||||
# ------------------------------------------------------------
|
||||
echo "[uninstall] Removing global user virtual environment if it exists..."
|
||||
if [[ -d "$VENV_DIR" ]]; then
|
||||
rm -rf "$VENV_DIR"
|
||||
echo "[uninstall] Removed: $VENV_DIR"
|
||||
else
|
||||
echo "[uninstall] No venv found at: $VENV_DIR"
|
||||
fi
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# Remove auto-activation lines from shell RC files
|
||||
# ------------------------------------------------------------
|
||||
RC_PATTERN='\.venvs\/pkgmgr\/bin\/activate"; if \[ -n "\$${PS1:-}" \]; then echo "Global Python virtual environment '\''~\/\.venvs\/pkgmgr'\'' activated."; fi; fi'
|
||||
|
||||
echo "[uninstall] Cleaning up ~/.bashrc and ~/.zshrc entries..."
|
||||
for rc in "$HOME/.bashrc" "$HOME/.zshrc"; do
|
||||
if [[ -f "$rc" ]]; then
|
||||
sed -i "/$RC_PATTERN/d" "$rc"
|
||||
echo "[uninstall] Cleaned $rc"
|
||||
else
|
||||
echo "[uninstall] File not found: $rc (skipped)"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "[uninstall] Done. Restart your shell (or run 'exec bash' or 'exec zsh') to apply changes."
|
||||
Reference in New Issue
Block a user