Fix setup stow flow
This commit is contained in:
@@ -11,7 +11,7 @@ base:
|
|||||||
|
|
||||||
# Stow shell files into $HOME.
|
# Stow shell files into $HOME.
|
||||||
stow:
|
stow:
|
||||||
stow --dir='{{project_root}}' Zsh --target="$HOME"
|
bash '{{scripts_dir}}/setup.sh' --stow-only
|
||||||
|
|
||||||
# Remove stowed shell files from $HOME.
|
# Remove stowed shell files from $HOME.
|
||||||
clean:
|
clean:
|
||||||
|
|||||||
1
Justfile
1
Justfile
@@ -4,6 +4,5 @@ mod bin "Commands/Bin"
|
|||||||
mod lang "Commands/Lang"
|
mod lang "Commands/Lang"
|
||||||
mod setup "Commands/Setup"
|
mod setup "Commands/Setup"
|
||||||
|
|
||||||
[default]
|
|
||||||
help:
|
help:
|
||||||
just --list --list-submodules
|
just --list --list-submodules
|
||||||
|
|||||||
4
Makefile
4
Makefile
@@ -8,6 +8,4 @@ all: setup
|
|||||||
# Bootstrap entrypoint for first-run setup.
|
# Bootstrap entrypoint for first-run setup.
|
||||||
# This intentionally keeps Make lightweight: base packages, then restow dotfiles.
|
# This intentionally keeps Make lightweight: base packages, then restow dotfiles.
|
||||||
setup:
|
setup:
|
||||||
bash $(SCRIPTS_DIR)/base.sh
|
bash $(SCRIPTS_DIR)/setup.sh --bootstrap-only
|
||||||
stow --dir=. -D Zsh --target="$$HOME" 2>/dev/null || true
|
|
||||||
stow --dir=. Zsh --target="$$HOME"
|
|
||||||
|
|||||||
@@ -101,7 +101,26 @@ backup_conflicting_home_files() {
|
|||||||
fi
|
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"
|
rm -f "$REBOOT_MARKER"
|
||||||
|
|
||||||
bash "$SCRIPT_DIR/base.sh"
|
bash "$SCRIPT_DIR/base.sh"
|
||||||
@@ -116,13 +135,23 @@ main() {
|
|||||||
bash "$SCRIPT_DIR/r.sh"
|
bash "$SCRIPT_DIR/r.sh"
|
||||||
handle_reboot_marker
|
handle_reboot_marker
|
||||||
|
|
||||||
sync_repo_managed_secret_file
|
stow_dotfiles
|
||||||
backup_conflicting_home_files
|
|
||||||
|
|
||||||
stow --dir="$REPO_ROOT" -D Zsh --target="$HOME" 2>/dev/null || true
|
|
||||||
stow --dir="$REPO_ROOT" Zsh --target="$HOME"
|
|
||||||
|
|
||||||
echo "Full setup completed."
|
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