fix: improve script execution logic by eliminating subshell in setup.sh
This commit is contained in:
6
setup.sh
6
setup.sh
@@ -25,8 +25,8 @@ if [ -d "$DOTFILES_DIR/scripts" ]; then
|
||||
|
||||
script_count=0
|
||||
|
||||
# Find all numbered scripts and run them in order
|
||||
find "$DOTFILES_DIR/scripts" -name '[0-9][0-9]-*.sh' -type f | sort | while read -r script; do
|
||||
# Find all numbered scripts and run them in order (no subshell)
|
||||
while read -r script; do
|
||||
script_name=$(basename "$script")
|
||||
log_info "Running $script_name..."
|
||||
|
||||
@@ -38,7 +38,7 @@ if [ -d "$DOTFILES_DIR/scripts" ]; then
|
||||
fi
|
||||
|
||||
((script_count++))
|
||||
done
|
||||
done < <(find "$DOTFILES_DIR/scripts" -name '[0-9][0-9]-*.sh' -type f | sort)
|
||||
|
||||
if [ $script_count -eq 0 ]; then
|
||||
log_warning "No numbered scripts found in scripts/ directory"
|
||||
|
||||
Reference in New Issue
Block a user