Skip to content

config: select steps via $SKIP and config.local instead of editing main() - #16

Open
presto8 wants to merge 1 commit into
mainfrom
feat/skip-list-config
Open

presto8 wants to merge 1 commit into
mainfrom
feat/skip-list-config

Conversation

@presto8

@presto8 presto8 commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Customizing an install meant commenting out call sites inside main(),
which puts every per-machine choice on the same lines that upstream
changes -- so each 'git pull' conflicts, and the local diff can never
be committed.

Route every step through a 'run' wrapper that consults a $SKIP list of
step names, and source an optional, gitignored config.local (looked up
via $PRESTOBUNTU_CONFIG, ./config.local, then
$XDG_CONFIG_HOME/prestobuntu/config.local) after user_config. Machine
state then lives entirely outside the tracked script.

run() splits $SKIP on any whitespace, so the list can span lines.
Verified: multi-line SKIP, empty SKIP, unset SKIP, and that a partial
name such as 'setup' does not skip 'setup_ssh'.

Note the two 'remove_package' steps share the key 'remove_package',
since skipping matches on the step name.


🤖 Generated with Claude Code

…in()

Customizing an install meant commenting out call sites inside main(),
which puts every per-machine choice on the same lines that upstream
changes -- so each 'git pull' conflicts, and the local diff can never
be committed.

Route every step through a 'run' wrapper that consults a $SKIP list of
step names, and source an optional, gitignored config.local (looked up
via $PRESTOBUNTU_CONFIG, ./config.local, then
$XDG_CONFIG_HOME/prestobuntu/config.local) after user_config. Machine
state then lives entirely outside the tracked script.

run() splits $SKIP on any whitespace, so the list can span lines.
Verified: multi-line SKIP, empty SKIP, unset SKIP, and that a partial
name such as 'setup' does not skip 'setup_ssh'.

Note the two 'remove_package' steps share the key 'remove_package',
since skipping matches on the step name.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new run() implementation can unintentionally glob-expand $SKIP entries (and the docs/error message need alignment with the new config.local behavior).

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR makes the setup installer script configurable per machine without requiring edits to main(), reducing merge conflicts during upstream updates by introducing a skip mechanism and local config sourcing.

Changes:

  • Added load_local_config() to source an optional per-machine config.local (via $PRESTOBUNTU_CONFIG, ./config.local, or $XDG_CONFIG_HOME/prestobuntu/config.local) after user_config.
  • Added run() wrapper and routed install steps through it, enabling skipping steps via a whitespace-separated $SKIP list.
  • Added config.local.example to document intended per-machine configuration.
File summaries
File Description
setup Adds local config loading and run() step wrapper; routes main install steps through run.
config.local.example Provides an example per-machine config showing how to set INSTALL_MODE and SKIP.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread setup
Comment on lines +45 to 57
run() {
: "run an install step unless its name appears in \$SKIP"
local step
# unquoted on purpose: splits on any whitespace, so SKIP may be
# written across several lines
for step in ${SKIP:-}; do
if [[ $step == "$1" ]]; then
info "skipping $1"
return
fi
done
"$@"
}
Comment thread setup
load_local_config

if [[ ! -v INSTALL_MODE || -z $INSTALL_MODE ]]; then
die "must customize user_config before running; hint: ${EDITOR:-nano} $0"
Comment thread config.local.example
Comment on lines +7 to +9
# Keeping machine-specific choices here rather than editing the setup
# script means "git pull" never conflicts with your customizations.
# config.local is gitignored.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants