Skip to content

Add PATH persistence and shell command refresh hints to installer#2

Merged
tingkai-c merged 1 commit into
mainfrom
codex/fix-easy-install-script-for-zsh
May 1, 2026
Merged

Add PATH persistence and shell command refresh hints to installer#2
tingkai-c merged 1 commit into
mainfrom
codex/fix-easy-install-script-for-zsh

Conversation

@tingkai-c

Copy link
Copy Markdown
Owner

Motivation

  • Improve post-install UX by ensuring the installed binary becomes available immediately in common shells.
  • Reduce confusion around shell command caches and missing PATH entries after installing localsend-cli.

Description

  • Add print_command_refresh_hint to print shell-specific instructions to refresh command lookup for zsh, bash/ksh/ash/dash/sh, fish, and a generic fallback.
  • Add persist_path_hint which writes a shell-appropriate PATH update into the user's rc file (~/.zshrc, ~/.bashrc, or ~/.config/fish/config.fish) if the line is not already present and creates the parent directory as needed.
  • Call persist_path_hint "$dir" when the chosen install directory is not on PATH, and call print_command_refresh_hint before the final usage hint.
  • Ensure the code checks for existing lines before appending and reports additions via info while preserving existing install flow.

Testing

  • Ran a syntax check with bash -n install.sh which succeeded.
  • Ran static analysis with shellcheck install.sh which reported no critical failures.

Codex Task

@tingkai-c
tingkai-c merged commit 307628e into main May 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant