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:
parent
4fcc2ce3bd
commit
afcae83970
1 changed files with 5 additions and 0 deletions
|
|
@ -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}"
|
||||
|
|
|
|||
Loading…
Reference in a new issue