Skip to content

Commit b43775b

Browse files
committed
Make installer update repair installs and remove wipe app data
1 parent be54af3 commit b43775b

1 file changed

Lines changed: 36 additions & 12 deletions

File tree

apps/installer/scripts/install.sh

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -319,14 +319,13 @@ case "\${1-}" in
319319
echo " Current version: \$VERSION"
320320
echo " Latest version: \$LATEST"
321321
322+
echo ""
322323
if [ "\$VERSION" = "\$LATEST" ]; then
323-
echo ""
324-
echo "PairUX is already up to date."
325-
exit 0
324+
echo "PairUX is already on the latest version."
325+
echo "Re-running installer to repair launcher/app integration..."
326+
else
327+
echo "Updating PairUX to v\$LATEST..."
326328
fi
327-
328-
echo ""
329-
echo "Updating PairUX to v\$LATEST..."
330329
if command -v curl >/dev/null 2>&1; then
331330
curl -fsSL "\$INSTALLER_URL/install.sh" | bash
332331
elif command -v wget >/dev/null 2>&1; then
@@ -361,6 +360,19 @@ case "\${1-}" in
361360
echo " Removed \$INSTALL_DIR"
362361
fi
363362
363+
# Remove app data/cache/logs for a full uninstall
364+
for path in \
365+
"\$HOME/Library/Application Support/pairux" \
366+
"\$HOME/Library/Caches/pairux" \
367+
"\$HOME/Library/Logs/pairux" \
368+
"\$HOME/Library/Saved Application State/com.profullstack.pairux.savedState"
369+
do
370+
if [ -e "\$path" ]; then
371+
rm -rf "\$path" 2>/dev/null || true
372+
echo " Removed \$path"
373+
fi
374+
done
375+
364376
# Remove this launcher script last
365377
echo " Removed \$BIN_DIR/pairux"
366378
echo ""
@@ -474,6 +486,19 @@ case "\${1-}" in
474486
echo " Removed \$INSTALL_DIR"
475487
fi
476488
489+
# Remove app data/cache/logs for a full uninstall
490+
for path in \
491+
"\$HOME/.config/pairux" \
492+
"\$HOME/.cache/pairux" \
493+
"\$HOME/.local/share/pairux" \
494+
"\$HOME/.local/state/pairux"
495+
do
496+
if [ -e "\$path" ]; then
497+
rm -rf "\$path" 2>/dev/null || true
498+
echo " Removed \$path"
499+
fi
500+
done
501+
477502
# Remove desktop entry
478503
if [ -f "\$DESKTOP_FILE" ]; then
479504
rm -f "\$DESKTOP_FILE"
@@ -511,14 +536,13 @@ case "\${1-}" in
511536
echo " Current version: \$VERSION"
512537
echo " Latest version: \$LATEST"
513538
539+
echo ""
514540
if [ "\$VERSION" = "\$LATEST" ]; then
515-
echo ""
516-
echo "PairUX is already up to date."
517-
exit 0
541+
echo "PairUX is already on the latest version."
542+
echo "Re-running installer to repair launcher/app integration..."
543+
else
544+
echo "Updating PairUX to v\$LATEST..."
518545
fi
519-
520-
echo ""
521-
echo "Updating PairUX to v\$LATEST..."
522546
if command -v curl >/dev/null 2>&1; then
523547
curl -fsSL "\$INSTALLER_URL/install.sh" | bash
524548
elif command -v wget >/dev/null 2>&1; then

0 commit comments

Comments
 (0)