From afcae83970526499db16c082a9d68d80fc3e8b33 Mon Sep 17 00:00:00 2001 From: Francy Lisboa Charuto Date: Wed, 4 Mar 2026 09:35:11 -0300 Subject: [PATCH] fix: Make installer idempotent by cleaning INSTALL_DIR before copying Removes the destination directory before each install so stale files from prior versions are not left behind. Co-Authored-By: Claude Opus 4.6 --- scripts/install-template.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/install-template.sh b/scripts/install-template.sh index 328562d..d90501e 100755 --- a/scripts/install-template.sh +++ b/scripts/install-template.sh @@ -531,6 +531,11 @@ install_files() { return 0 fi + # Clean existing install for idempotency (remove stale files from prior installs). + if [ -d "$INSTALL_DIR" ]; then + rm -rf "$INSTALL_DIR" + fi + # Create destination directory. if ! mkdir -p "$INSTALL_DIR" 2>/dev/null; then error "Cannot create directory: ${INSTALL_DIR}"