Skip to content

fix: ensure installer PATH is exported and persistent#13404

Closed
omatheusmesmo wants to merge 1 commit into
anomalyco:devfrom
omatheusmesmo:fix/installer-path-issue
Closed

fix: ensure installer PATH is exported and persistent#13404
omatheusmesmo wants to merge 1 commit into
anomalyco:devfrom
omatheusmesmo:fix/installer-path-issue

Conversation

@omatheusmesmo

Copy link
Copy Markdown

What does this PR do?

Fixes #13403

This PR improves the installation script to handle environments where shell configuration files (like .bashrc) might not exist or where the PATH isn't updated in the current session after installation.

Changes made:

  • Added mkdir and touch to guarantee the target config file exists before attempting to grep or append to it.
  • Added an immediate export PATH within the script so the opencode command can be used in the same session that ran the installer.
  • Updated the final UI logic to check if the command is actually available. If not, it provides a clear source instruction for the user.

These changes work because they address both disk persistence and current shell memory, preventing the "command not found" error on minimal Linux distros (like Debian/Armbian) immediately after a successful install.

How did you verify your code works?

Tested on Debian Bookworm (Orange Pi 5) via SSH:

  1. Confirmed opencode was not found.
  2. Ran the modified install.sh.
  3. Verified the progress bar and ASCII art rendered correctly.
  4. Immediately ran opencode -v without restarting the terminal or manual sourcing.
  5. Result: Command recognized correctly.

Terminal session:

opi5@homelab:~$ opencode
opencode: command not found

opi5@homelab:~$ ./install_opencode.sh
Installing opencode version: 1.1.64
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 100%

Successfully installed opencode!

opi5@homelab:~$ opencode -v
1.1.64

- Adds mkdir and touch to guarantee config file existence before grep
- Exports PATH to the current shell session for immediate use
- Provides a source instruction fallback if the command is not yet hashed
- Fixes anomalyco#13403
@github-actions

Copy link
Copy Markdown
Contributor

Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR.

@github-actions github-actions Bot closed this Apr 14, 2026
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.

Installer does not refresh PATH or prompt for source after successful installation

1 participant