diff --git a/Commands/Setup/mod.just b/Commands/Setup/mod.just index 14487b9..d35696b 100644 --- a/Commands/Setup/mod.just +++ b/Commands/Setup/mod.just @@ -11,7 +11,7 @@ base: # Stow shell files into $HOME. stow: - stow --dir='{{project_root}}' Zsh --target="$HOME" + bash '{{scripts_dir}}/setup.sh' --stow-only # Remove stowed shell files from $HOME. clean: diff --git a/Justfile b/Justfile index c4e8cff..7582986 100644 --- a/Justfile +++ b/Justfile @@ -4,6 +4,5 @@ mod bin "Commands/Bin" mod lang "Commands/Lang" mod setup "Commands/Setup" -[default] help: just --list --list-submodules diff --git a/Makefile b/Makefile index 6fde350..6332efc 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,4 @@ all: setup # Bootstrap entrypoint for first-run setup. # This intentionally keeps Make lightweight: base packages, then restow dotfiles. setup: - bash $(SCRIPTS_DIR)/base.sh - stow --dir=. -D Zsh --target="$$HOME" 2>/dev/null || true - stow --dir=. Zsh --target="$$HOME" + bash $(SCRIPTS_DIR)/setup.sh --bootstrap-only diff --git a/Scripts/setup.sh b/Scripts/setup.sh index 127868f..28afafa 100644 --- a/Scripts/setup.sh +++ b/Scripts/setup.sh @@ -101,7 +101,26 @@ backup_conflicting_home_files() { fi } -main() { +stow_dotfiles() { + sync_repo_managed_secret_file + backup_conflicting_home_files + + stow --dir="$REPO_ROOT" -D Zsh --target="$HOME" 2>/dev/null || true + stow --dir="$REPO_ROOT" Zsh --target="$HOME" +} + +bootstrap_only() { + rm -f "$REBOOT_MARKER" + + bash "$SCRIPT_DIR/base.sh" + handle_reboot_marker + + stow_dotfiles + + echo "Bootstrap setup completed." +} + +full_setup() { rm -f "$REBOOT_MARKER" bash "$SCRIPT_DIR/base.sh" @@ -116,13 +135,23 @@ main() { bash "$SCRIPT_DIR/r.sh" handle_reboot_marker - sync_repo_managed_secret_file - backup_conflicting_home_files - - stow --dir="$REPO_ROOT" -D Zsh --target="$HOME" 2>/dev/null || true - stow --dir="$REPO_ROOT" Zsh --target="$HOME" + stow_dotfiles echo "Full setup completed." } -main "$@" +case "${1:-}" in + --bootstrap-only) + bootstrap_only + ;; + --stow-only) + stow_dotfiles + ;; + "") + full_setup + ;; + *) + echo "Usage: $0 [--bootstrap-only|--stow-only]" + exit 1 + ;; +esac