fix: print shell reload hint after fresh install (#317)#393
Merged
UtkarshBhardwaj007 merged 1 commit intoJun 16, 2026
Merged
Conversation
A curl|bash install runs in a child process and cannot mutate the caller's live PATH, so the new playground/pg command isn't found until the shell reloads. Detect a fresh install and print the exact source command for the user's shell (zsh/bash/fish) so they can use it now. The fresh-install check matches both ~/.polkadot/bin and ~/.local/bin so the hint is suppressed whenever the command already resolves (e.g. when ~/.local/bin is already on PATH, as it is by default on Debian/Ubuntu).
abdec51 to
ce94485
Compare
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.
Problem
Fixes #317. After a
curl … | bashinstall, theplayground/pgcommand isn't found until the user reloads their shell.install.shruns in a child process: it appends the PATH export to the rc files and exports PATH for its own process (so its ownlogin --yesworks via the full binary path), but it cannot mutate the parent interactive shell's environment. So when the user then types the suggestedplayground login, the command isn't on PATH yet.The issue suggests
source ~/.bashrcat the end of install — but that can't work for this case: sourcing inside the install script only affects the script's own (dying) process, not the parent shell. The honest fix is to tell the user exactly how to make the command available now.Change
$INSTALL_DIR/binis already on the caller's PATH before we modify anything. On an upgrade the command already resolves, so the hint is suppressed (no noise).$SHELL(~/.zshrc/~/.bashrc/ fish config) and tell the user tosourceit or open a new terminal. The path prints as a portable$HOMEliteral so it's copy-pasteable.A code comment documents why we don't try to
sourceanything, so it isn't "helpfully" re-added later as a no-op.Verification
bash -n install.shpasses.🤖 Generated with Claude Code