- Add scripts/ directory with numbered execution pattern - Create 00-check-dependencies.sh for requirement validation - Create 10-backup-files.sh for conflict handling - Create 20-setup-stow.sh for symlink creation - Create 90-post-install.sh for cleanup tasks - Add scripts/utils.sh with colored logging functions - Update install.sh to auto-discover and execute numbered scripts - Remove hardcoded logic in favor of flexible script discovery Benefits: - Clean separation of concerns (each script has one job) - Numbered execution order (SSH/systemd convention) - Colored output for better UX - Easy to extend with additional scripts - Same entry point for all branches
27 lines
635 B
Bash
27 lines
635 B
Bash
#!/bin/bash
|
|
# scripts/90-post-install.sh - Post-installation tasks
|
|
|
|
set -euo pipefail
|
|
|
|
# Source utilities
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
source "$SCRIPT_DIR/utils.sh"
|
|
|
|
post_install() {
|
|
log_info "Running post-installation tasks..."
|
|
|
|
# Source the new bashrc if in interactive shell
|
|
if is_interactive && [ -f "$HOME/.bashrc" ]; then
|
|
log_info "Reloading Bash config..."
|
|
source "$HOME/.bashrc"
|
|
fi
|
|
|
|
# Show completion message
|
|
log_success "Post-installation tasks complete"
|
|
}
|
|
|
|
# Run if called directly
|
|
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
|
post_install
|
|
fi
|