Compare commits
2 Commits
058210a7a8
...
76abbd7d1d
| Author | SHA1 | Date | |
|---|---|---|---|
| 76abbd7d1d | |||
| 980fa75310 |
@@ -45,7 +45,7 @@ check_dependencies() {
|
|||||||
echo ""
|
echo ""
|
||||||
done
|
done
|
||||||
|
|
||||||
exit 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
log_success "All dependencies satisfied"
|
log_success "All dependencies satisfied"
|
||||||
|
|||||||
13
setup.sh
13
setup.sh
@@ -23,28 +23,27 @@ log_info "Working directory: $DOTFILES_DIR"
|
|||||||
if [ -d "$DOTFILES_DIR/scripts" ]; then
|
if [ -d "$DOTFILES_DIR/scripts" ]; then
|
||||||
log_info "Running setup scripts..."
|
log_info "Running setup scripts..."
|
||||||
|
|
||||||
# Look for numbered scripts and run them in order
|
|
||||||
script_count=0
|
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
|
if [ -f "$script" ]; then
|
||||||
script_name=$(basename "$script")
|
script_name=$(basename "$script")
|
||||||
log_info "Running $script_name..."
|
log_info "Running $script_name..."
|
||||||
|
# Source the script to run in the current shell and receive $DOTFILES_DIR as $1
|
||||||
if bash "$script" "$DOTFILES_DIR"; then
|
if source "$script" "$DOTFILES_DIR"; then
|
||||||
log_success "✓ $script_name completed"
|
log_success "✓ $script_name completed"
|
||||||
else
|
else
|
||||||
log_error "✗ $script_name failed"
|
log_error "✗ $script_name failed"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
((++script_count))
|
||||||
((script_count++))
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ $script_count -eq 0 ]; then
|
if [ $script_count -eq 0 ]; then
|
||||||
log_warning "No numbered scripts found in scripts/ directory"
|
log_warning "No numbered scripts found in scripts/ directory"
|
||||||
else
|
else
|
||||||
log_success "Completed $script_count setup script(s)"
|
log_success "Completed $script_count setup scripts"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
log_error "No scripts directory found! Something went wrong with the installation."
|
log_error "No scripts directory found! Something went wrong with the installation."
|
||||||
|
|||||||
Reference in New Issue
Block a user