Conversation
…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>
There was a problem hiding this comment.
🟡 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-machineconfig.local(via$PRESTOBUNTU_CONFIG,./config.local, or$XDG_CONFIG_HOME/prestobuntu/config.local) afteruser_config. - Added
run()wrapper and routed install steps through it, enabling skipping steps via a whitespace-separated$SKIPlist. - Added
config.local.exampleto 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 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 | ||
| "$@" | ||
| } |
| load_local_config | ||
|
|
||
| if [[ ! -v INSTALL_MODE || -z $INSTALL_MODE ]]; then | ||
| die "must customize user_config before running; hint: ${EDITOR:-nano} $0" |
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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