Skip to content

Commit

Permalink
Add checks to my full_upgrade && my full_clean scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
lainiwa committed Feb 26, 2022
1 parent a8efc35 commit 42fb447
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions scripts/my
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,8 @@ EOF
poetry self update || true
fi
# Upgrade pip and pipx
if pip freeze |grep -q pipx 2>/dev/null; then
if command -v pip >/dev/null &&
pip freeze |grep -q pipx 2>/dev/null; then
pip install --user --upgrade pip
pip install --user --upgrade pipx
fi
Expand Down Expand Up @@ -444,9 +445,13 @@ full_clean() {
nix-store --optimise
nix-collect-garbage --delete-old
fi
docker system prune --force --all
docker volume rm \$(docker volume ls -q) || true
podman system prune --all --force && podman rmi --all
if command -v docker >/dev/null; then
docker system prune --force --all
docker volume rm \$(docker volume ls -q) || true
fi
if command -v podman >/dev/null; then
podman system prune --all --force && podman rmi --all
fi
EOF
# Garbage-collect nix
if command -v nix >/dev/null; then
Expand Down

0 comments on commit 42fb447

Please sign in to comment.