1
0

fix: refactor script execution to use a classic for loop for better readability

This commit is contained in:
2025-08-04 22:38:04 -05:00
parent f442da453c
commit 9ce597b847

View File

@@ -25,20 +25,19 @@ if [ -d "$DOTFILES_DIR/scripts" ]; then
script_count=0
# Find all numbered scripts and run them in order (no subshell)
while read -r script; do
# Find all numbered scripts and run them in order (classic for loop)
mapfile -t scripts < <(find "$DOTFILES_DIR/scripts" -name '[0-9][0-9]-*.sh' -type f | sort)
for script in "${scripts[@]}"; do
script_name=$(basename "$script")
log_info "Running $script_name..."
if bash "$script" "$DOTFILES_DIR"; then
log_success "$script_name completed"
else
log_error "$script_name failed"
exit 1
fi
((script_count++))
done < <(find "$DOTFILES_DIR/scripts" -name '[0-9][0-9]-*.sh' -type f | sort)
done
if [ $script_count -eq 0 ]; then
log_warning "No numbered scripts found in scripts/ directory"