Fix setup stow flow

This commit is contained in:
MangoPig
2026-06-02 18:15:46 +01:00
parent f2be49aaac
commit 7996568696
4 changed files with 38 additions and 12 deletions

View File

@@ -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:

View File

@@ -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

View File

@@ -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"

View File

@@ -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