fix(uninstall): robustly remove pkgmgr venv auto-activation and leftover shell RC entries
Some checks failed
Mark stable commit / test-unit (push) Has been cancelled
Mark stable commit / test-integration (push) Has been cancelled
Mark stable commit / test-env-virtual (push) Has been cancelled
Mark stable commit / test-env-nix (push) Has been cancelled
Mark stable commit / test-e2e (push) Has been cancelled
Mark stable commit / test-virgin-user (push) Has been cancelled
Mark stable commit / test-virgin-root (push) Has been cancelled
Mark stable commit / codesniffer-shellcheck (push) Has been cancelled
Mark stable commit / codesniffer-ruff (push) Has been cancelled
Mark stable commit / mark-stable (push) Has been cancelled
Some checks failed
Mark stable commit / test-unit (push) Has been cancelled
Mark stable commit / test-integration (push) Has been cancelled
Mark stable commit / test-env-virtual (push) Has been cancelled
Mark stable commit / test-env-nix (push) Has been cancelled
Mark stable commit / test-e2e (push) Has been cancelled
Mark stable commit / test-virgin-user (push) Has been cancelled
Mark stable commit / test-virgin-root (push) Has been cancelled
Mark stable commit / codesniffer-shellcheck (push) Has been cancelled
Mark stable commit / codesniffer-ruff (push) Has been cancelled
Mark stable commit / mark-stable (push) Has been cancelled
This commit is contained in:
@@ -19,12 +19,20 @@ fi
|
|||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
# Remove auto-activation lines from shell RC files
|
# 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'
|
# Matches:
|
||||||
|
# ~/.venvs/pkgmgr/bin/activate
|
||||||
|
# ./.venvs/pkgmgr/bin/activate
|
||||||
|
RC_PATTERN='(\./)?\.venvs/pkgmgr/bin/activate'
|
||||||
|
|
||||||
echo "[uninstall] Cleaning up ~/.bashrc and ~/.zshrc entries..."
|
echo "[uninstall] Cleaning up ~/.bashrc and ~/.zshrc entries..."
|
||||||
for rc in "$HOME/.bashrc" "$HOME/.zshrc"; do
|
for rc in "$HOME/.bashrc" "$HOME/.zshrc"; do
|
||||||
if [[ -f "$rc" ]]; then
|
if [[ -f "$rc" ]]; then
|
||||||
sed -i "/$RC_PATTERN/d" "$rc"
|
# Remove activation lines (functional)
|
||||||
|
sed -E -i "/$RC_PATTERN/d" "$rc"
|
||||||
|
|
||||||
|
# Remove leftover echo / cosmetic lines referencing pkgmgr venv
|
||||||
|
sed -i '/\.venvs\/pkgmgr/d' "$rc"
|
||||||
|
|
||||||
echo "[uninstall] Cleaned $rc"
|
echo "[uninstall] Cleaned $rc"
|
||||||
else
|
else
|
||||||
echo "[uninstall] File not found: $rc (skipped)"
|
echo "[uninstall] File not found: $rc (skipped)"
|
||||||
|
|||||||
Reference in New Issue
Block a user