Repository navigation
fix: clearer reinstall message, clean up failed installs, use $SHELL for PATH, check disk space - #39
Merged
Merged
Conversation
…for PATH, check disk space Fixes #27, #29, #31, shorebirdtech/shorebird#1942. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Adversarial review (separate agent, no context from the author; bash findings verified locally on macOS bash 3.2, PowerShell findings from reading the code and docs)
Checked and fine: bash |
- Printed reinstall command follows the shorebird.dev redirect (-L). - Tell a complete install (upgrade) from an incomplete one (reinstall). - macOS bash: write to the first of .bash_profile/.bash_login/.profile. - Windows: already-installed returns without error again (setup-shorebird reruns it); quote the printed path; clean up in finally so Ctrl-C is covered; skip the disk check off local drives; keep the real error if removal fails. - CI reruns each installer and checks the already-installed message. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Addressed in f186c52:
|
Contributor
Author
|
lgtm |
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.
Why
Four install-script reports, all about a first install going wrong with no clear way forward:
~/.shorebirdbehind, so the next run says "Existing Shorebird installation detected. Use --force to overwrite." and the user can't fix it without knowing where--forcegoes incurl ... | bash..bashrc/.zshrcif that file already exists, so a user without one gets no PATH entry.What changes
install.sh)install.ps1)EXITtrap removes the partial~/.shorebirdand says to reruntry/finally(checking$LASTEXITCODEof git andshorebird.ps1) removes it and says to rerun;finallybecause Ctrl-C skipscatchbin/cache/shorebird.snapshot) getsshorebird upgradeplus the reinstall command; an incomplete one (left by the old installer) gets only the reinstall command,curl ... -sSfL https://shorebird.dev/install.sh | bash -s -- --forceRemove-Item "<dir>"thenirm ... | iex(iexcan't pass--force). Still returns without error, as before:setup-shorebirdreruns it on persistent runners and uses the existing install$SHELL: zsh${ZDOTDIR:-$HOME}/.zshrc, bash.bashrc(on macOS, where Terminal starts bash as a login shell, the first of.bash_profile,.bash_login,.profilethat exists, else a new.bash_profile); creates it if missing; skips if the line is already there. Other shells get the manual line, as beforeIO.DriveInfo; skipped when the profile isn't on a local drive (UNC)PowerShell's git checks now
throwinstead ofexit 1. The documented command isirm ... | iex, whereexitcloses the user's PowerShell window before they can read the error;throwstops the script, leaves the window open, and still exits nonzero under./install.ps1in CI.Standard way: rustup, Homebrew and nvm installers pick the profile from
$SHELLand dedupe the line the same way; removing a partial install on failure is the usual alternative to resumable installs, and much simpler since the install is a fresh clone either way.The new messages use
https://shorebird.dev/install.sh/.ps1, which redirect here (https://github.com/shorebirdtech/_shorebird/issues/2832, already closed) and are what the docs show.Not done: fish (
$SHELL= fish still gets the manual instruction; it needs fish syntax, notexport).What could go wrong
.bashrc. Previously the.bashrcline didn't take effect in Terminal for them, so this should only fix things.dfexcludes purgeable space, so a Mac near 3GB free may be refused while Finder shows more; the error says how much is free.CI now reruns each installer after the install and checks the already-installed message. Tested locally on macOS: complete and incomplete existing-install messages; the printed reinstall command fetches a script that parses; a failing
git clone(fake git) removes the partial dir and exits 128; rc-file selection for zsh/bash/fish/unset and the macOS profile order, file creation and dedupe;df -Pkparse. PowerShell isn't installed here; CI's Windows e2e job runs the success path.Screenshots
No visible change: shell scripts only.
Landing
Once approved and green.
Fixes #27
Fixes #29
Fixes #31
Fixes shorebirdtech/shorebird#1942
🤖 Generated with Claude Code