fix: make uninstall keeps images and data when user answers no
Previously 'n' still ran --rmi all, removing Docker images. Now: - n (default): docker-compose down only — containers gone, images and data/config untouched; 'make start' brings everything back immediately - y: full wipe — containers, images, config/ and data/ all removed Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -35,7 +35,7 @@ help:
|
||||
@echo "Updates & reinstall:"
|
||||
@echo " update - git pull + rebuild + restart (deploy latest code)"
|
||||
@echo " reinstall - Full wipe and fresh install from current git checkout"
|
||||
@echo " uninstall - Stop + remove images; prompts whether to also wipe data"
|
||||
@echo " uninstall - Stop + remove containers; prompts whether to also delete data"
|
||||
@echo ""
|
||||
@echo "Build:"
|
||||
@echo " build - Rebuild API image"
|
||||
@@ -138,22 +138,22 @@ reinstall:
|
||||
|
||||
uninstall:
|
||||
@echo ""
|
||||
@echo "WARNING: This will stop all containers and remove all Docker images."
|
||||
@echo "This will stop and remove all containers."
|
||||
@echo ""
|
||||
@printf "Also wipe all data and config? This cannot be undone. [y/N/cancel]: "; \
|
||||
@printf "Also delete config/ and data/? This cannot be undone. [y/N/cancel]: "; \
|
||||
read ans; \
|
||||
case "$$ans" in \
|
||||
y|Y) \
|
||||
echo "Stopping containers and removing images..."; \
|
||||
PUID=$$(id -u) PGID=$$(id -g) $(DC) down -v --rmi all 2>/dev/null || true; \
|
||||
echo "Wiping config/ and data/..."; \
|
||||
echo "Deleting config/ and data/..."; \
|
||||
sudo rm -rf config/ data/; \
|
||||
echo "Uninstall complete. Git repo and scripts remain."; \
|
||||
;; \
|
||||
n|N|"") \
|
||||
echo "Stopping containers and removing images (keeping data)..."; \
|
||||
PUID=$$(id -u) PGID=$$(id -g) $(DC) down --rmi all 2>/dev/null || true; \
|
||||
echo "Done. config/ and data/ are untouched. Run 'make setup && make start' to reinstall."; \
|
||||
echo "Stopping and removing containers (keeping images and data)..."; \
|
||||
PUID=$$(id -u) PGID=$$(id -g) $(DC) down 2>/dev/null || true; \
|
||||
echo "Done. Images, config/ and data/ are untouched. Run 'make start' to bring it back up."; \
|
||||
;; \
|
||||
*) \
|
||||
echo "Cancelled."; \
|
||||
|
||||
Reference in New Issue
Block a user