Skip to content

fix: print shell reload hint after fresh install (#317)#393

Merged
UtkarshBhardwaj007 merged 1 commit into
paritytech:mainfrom
shawntabrizi:fix/install-path-reload-hint
Jun 16, 2026
Merged

fix: print shell reload hint after fresh install (#317)#393
UtkarshBhardwaj007 merged 1 commit into
paritytech:mainfrom
shawntabrizi:fix/install-path-reload-hint

Conversation

@shawntabrizi

Copy link
Copy Markdown
Member

Problem

Fixes #317. After a curl … | bash install, the playground / pg command isn't found until the user reloads their shell.

install.sh runs in a child process: it appends the PATH export to the rc files and exports PATH for its own process (so its own login --yes works via the full binary path), but it cannot mutate the parent interactive shell's environment. So when the user then types the suggested playground login, the command isn't on PATH yet.

The issue suggests source ~/.bashrc at 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

  1. Detect re-installs up front — capture whether $INSTALL_DIR/bin is already on the caller's PATH before we modify anything. On an upgrade the command already resolves, so the hint is suppressed (no noise).
  2. Print an exact reload hint on fresh installs — resolve the rc file from $SHELL (~/.zshrc / ~/.bashrc / fish config) and tell the user to source it or open a new terminal. The path prints as a portable $HOME literal so it's copy-pasteable.

A code comment documents why we don't try to source anything, so it isn't "helpfully" re-added later as a no-op.

Verification

  • bash -n install.sh passes.
  • Hint renders correctly for zsh and fish (verified manually).

🤖 Generated with Claude Code

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).
@UtkarshBhardwaj007 UtkarshBhardwaj007 force-pushed the fix/install-path-reload-hint branch from abdec51 to ce94485 Compare June 16, 2026 22:36
@UtkarshBhardwaj007 UtkarshBhardwaj007 merged commit a325ced into paritytech:main Jun 16, 2026
16 of 18 checks passed
@shawntabrizi shawntabrizi deleted the fix/install-path-reload-hint branch June 17, 2026 09:11
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.

[BUG] After install, binary unusable until shell reload / PATH not sourced

2 participants