fix update

This commit is contained in:
2026-10-19 13:56:54 -06:00
parent a15eac4240
commit a65f07c22e
21 changed files with 241 additions and 64 deletions
+16 -2
View File
@@ -1,4 +1,18 @@
#!/bin/bash
echo "Updating pipx applications..."
pipx upgrade-all
# pipx venvs are tied to the Python they were built with, so a Python upgrade
# breaks them in a way `pipx upgrade-all` can't repair. Rebuild them when the
# Python version changes, or when an upgrade fails.
STAMP="$HOME/.local/state/coredesktop/pipx-python-version"
CURRENT_PYTHON="$(python3 -c 'import sys; print("%d.%d" % sys.version_info[:2])')"
if [ "$(cat "$STAMP" 2>/dev/null)" != "$CURRENT_PYTHON" ]; then
echo "Python changed to $CURRENT_PYTHON, reinstalling pipx applications..."
pipx reinstall-all
else
echo "Updating pipx applications..."
if ! pipx upgrade-all; then
echo "pipx upgrade-all failed, reinstalling pipx applications..."
pipx reinstall-all
fi
fi && mkdir -p "$(dirname "$STAMP")" && echo "$CURRENT_PYTHON" > "$STAMP"