updated script
This commit is contained in:
Executable → Regular
+20
@@ -515,6 +515,26 @@ main() {
|
||||
cd - > /dev/null
|
||||
fi
|
||||
|
||||
# Clean output directory before rendering (preserve .git only)
|
||||
# This prevents stale files from old runs accumulating
|
||||
if [[ "$DRY_RUN" != "true" ]]; then
|
||||
local stale_count=0
|
||||
for item in "${OUTPUT_DIR}"/*; do
|
||||
[[ -e "$item" ]] || continue
|
||||
rm -rf "$item"
|
||||
stale_count=$((stale_count + 1))
|
||||
done
|
||||
# Also remove hidden files except .git
|
||||
for item in "${OUTPUT_DIR}"/.[!.]*; do
|
||||
[[ -e "$item" ]] || continue
|
||||
[[ "$(basename "$item")" == ".git" ]] && continue
|
||||
rm -rf "$item"
|
||||
done
|
||||
if [[ $stale_count -gt 0 ]]; then
|
||||
log_info "Cleaned ${stale_count} item(s) from output directory"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Render each customer
|
||||
local success_count=0
|
||||
for customer_file in "${customer_files[@]}"; do
|
||||
|
||||
Reference in New Issue
Block a user