Fix setup stow flow
This commit is contained in:
@@ -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:
|
||||
|
||||
1
Justfile
1
Justfile
@@ -4,6 +4,5 @@ mod bin "Commands/Bin"
|
||||
mod lang "Commands/Lang"
|
||||
mod setup "Commands/Setup"
|
||||
|
||||
[default]
|
||||
help:
|
||||
just --list --list-submodules
|
||||
|
||||
4
Makefile
4
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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user