Conversation
get_prestobuntu_file always fetched from raw.githubusercontent.com, so running 'bash setup' from a clone overwrote ~/.config/nvim/init.lua, ~/.gitconfig, tmux.conf and the rest with the versions published on main -- not the ones sitting next to the script. Editing a config file and re-running the installer silently discarded the edit, which makes the README's 'inspect and verify the script' workflow misleading. Prefer $PRESTOBUNTU_DIR/<name> when the script is running from a file, and fall back to the download otherwise. Set PRESTOBUNTU_FORCE_DOWNLOAD=1 to keep the old always-fetch behaviour. PRESTOBUNTU_DIR is deliberately left empty when the script is piped into bash: BASH_SOURCE is empty in that case and 'dirname ""' yields ".", which would treat an unrelated current directory as a checkout and install any same-named file found there. Verified the resolution is correct both as a file and under 'cat setup | bash'. Also makes $base local; it was leaking into the global namespace. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
The change is narrowly scoped, matches the stated problem, and preserves the existing download fallback behavior with a clear opt-out flag.
Pull request overview
This PR updates the setup installer to prefer configuration files from a local prestobuntu checkout (when the script is executed from a file) instead of always downloading from raw.githubusercontent.com, preventing local edits from being silently overwritten.
Changes:
- Detects the script’s on-disk directory via
BASH_SOURCEand stores it inPRESTOBUNTU_DIR(left empty when running from stdin). - Updates
get_prestobuntu_fileto install from$PRESTOBUNTU_DIR/<name>when available, withPRESTOBUNTU_FORCE_DOWNLOAD=1to force remote downloads. - Makes the GitHub raw URL
basevariable local to avoid leaking it globally.
File summaries
| File | Description |
|---|---|
| setup | Prefer installing config files from a local checkout when available; add an env override to force downloads; scope URL base locally. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
get_prestobuntu_file always fetched from raw.githubusercontent.com, so
running 'bash setup' from a clone overwrote ~/.config/nvim/init.lua,
~/.gitconfig, tmux.conf and the rest with the versions published on
main -- not the ones sitting next to the script. Editing a config file
and re-running the installer silently discarded the edit, which makes
the README's 'inspect and verify the script' workflow misleading.
Prefer $PRESTOBUNTU_DIR/ when the script is running from a file,
and fall back to the download otherwise. Set PRESTOBUNTU_FORCE_DOWNLOAD=1
to keep the old always-fetch behaviour.
PRESTOBUNTU_DIR is deliberately left empty when the script is piped
into bash: BASH_SOURCE is empty in that case and 'dirname ""' yields
".", which would treat an unrelated current directory as a checkout
and install any same-named file found there. Verified the resolution
is correct both as a file and under 'cat setup | bash'.
Also makes $base local; it was leaking into the global namespace.
🤖 Generated with Claude Code