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 <noreply@anthropic.com>
This commit is contained in:
Francy Lisboa Charuto 2026-03-04 09:35:11 -03:00
parent 4fcc2ce3bd
commit afcae83970

View file

@ -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}"