diff --git a/scripts/00-check-dependencies.sh b/scripts/00-check-dependencies.sh index 3a84bb5..9f13408 100644 --- a/scripts/00-check-dependencies.sh +++ b/scripts/00-check-dependencies.sh @@ -45,7 +45,7 @@ check_dependencies() { echo "" done - exit 1 + return 1 fi log_success "All dependencies satisfied" diff --git a/setup.sh b/setup.sh index 751f2ab..c5af018 100644 --- a/setup.sh +++ b/setup.sh @@ -23,28 +23,27 @@ log_info "Working directory: $DOTFILES_DIR" if [ -d "$DOTFILES_DIR/scripts" ]; then log_info "Running setup scripts..." - # Look for numbered scripts and run them in order script_count=0 - for script in "$DOTFILES_DIR"/scripts/[0-9][0-9]-*.sh; do + # Find and run all numbered scripts using shell globbing + for script in "$DOTFILES_DIR/scripts"/[0-9][0-9]-*.sh; do if [ -f "$script" ]; then script_name=$(basename "$script") log_info "Running $script_name..." - - if bash "$script" "$DOTFILES_DIR"; then + # Source the script to run in the current shell and receive $DOTFILES_DIR as $1 + if source "$script" "$DOTFILES_DIR"; then log_success "✓ $script_name completed" else log_error "✗ $script_name failed" exit 1 fi - - ((script_count++)) + ((++script_count)) fi done if [ $script_count -eq 0 ]; then log_warning "No numbered scripts found in scripts/ directory" else - log_success "Completed $script_count setup script(s)" + log_success "Completed $script_count setup scripts" fi else log_error "No scripts directory found! Something went wrong with the installation."