Installer PATH output #735

Closed
opened 2025-12-15 16:00:45 +00:00 by namnatulco · 4 comments
Contributor

The installer outputs a prompt suggesting a path add:

https://git.coopcloud.tech/toolshed/abra/src/branch/main/scripts/installer/installer#L92

which (at least for bash) results in:

echo PATH=$PATH:/path/to/installed/abra/bin >> $HOME/.bashrc

if a user copies and runs this, this does not lead to the desired outcome (PATH expands into .bashrc and may fail if the path contains spaces or other characters interpreted by the shell)

I think a preferred way to do this would be:

echo "echo 'PATH=\$\{PATH\}:'$p >> $HOME/.bashrc"

which after output would read:

echo 'PATH=${PATH}':/path/to/abra/bin >> ~/.bashrc

which leads to:

  • no expansion while writing (single quotes)
  • no errors on .rc interpretation (curly braces)

however, I'm not sure whether this syntax is sh-compatible and I figured it'd be good if this change would come from someone with more experience, so I though I'd make an issue.

The installer outputs a prompt suggesting a path add: https://git.coopcloud.tech/toolshed/abra/src/branch/main/scripts/installer/installer#L92 which (at least for bash) results in: `echo PATH=$PATH:/path/to/installed/abra/bin >> $HOME/.bashrc` if a user copies and runs this, this does not lead to the desired outcome (PATH expands into .bashrc and may fail if the path contains spaces or other characters interpreted by the shell) I *think* a preferred way to do this would be: `echo "echo 'PATH=\$\{PATH\}:'$p >> $HOME/.bashrc"` which after output would read: `echo 'PATH=${PATH}':/path/to/abra/bin >> ~/.bashrc` which leads to: - no expansion while writing (single quotes) - no errors on .rc interpretation (curly braces) however, I'm not sure whether this syntax is sh-compatible and I figured it'd be good if this change would come from someone with more experience, so I though I'd make an issue.
Owner

@knoflook any thoughts as our resident installer script expert?

Thanks @namnatulco! Feel free to take a stab at a fix if you want! We can all test it 🙏

@knoflook any thoughts as our resident installer script expert? Thanks @namnatulco! Feel free to take a stab at a fix if you want! We can all test it 🙏
decentral1se added the
installer
label 2026-01-01 17:44:26 +00:00
Author
Contributor

I think I figured out a cleaner fix: 5b3929d885

This doesn't rely on the ${VAR} expansion, which I thought was bash-only.

it outputs something like:
echo PATH="$PATH:/home/namnatulco/.local/bin" >> /home/namnatulco/.bashrc

I used this to check:

#!/bin/sh

p=$HOME/.local/bin
com='echo PATH="$PATH:'"$p"'"'

echo "$com >> $HOME/.bashrc"

I tried to make a PR, but https://git.coopcloud.tech/toolshed/abra/compare/main...namnatulco/abra:fix-735?expand=1 says there is no change, even though the above commit shows. Maybe that's just a caching bug or something? I'll try again later.

I think I figured out a cleaner fix: https://git.coopcloud.tech/namnatulco/abra/commit/5b3929d885b60a8f141573849f7d88cbbf84c69c This doesn't rely on the `${VAR}` expansion, which I thought was bash-only. it outputs something like: `echo PATH="$PATH:/home/namnatulco/.local/bin" >> /home/namnatulco/.bashrc` I used this to check: ```sh #!/bin/sh p=$HOME/.local/bin com='echo PATH="$PATH:'"$p"'"' echo "$com >> $HOME/.bashrc" ``` I tried to make a PR, but https://git.coopcloud.tech/toolshed/abra/compare/main...namnatulco/abra:fix-735?expand=1 says there is no change, even though the above commit shows. Maybe that's just a caching bug or something? I'll try again later.
Owner

@namnatulco nice! I think it's because your commit is in the main branch of your fork and also in the branch. So it's confusing whatever logic makes the pull request diff. Try removing the commit from your main branch and opening the PR again from your branch?

@namnatulco nice! I think it's because your commit is in the main branch of your fork and also in the branch. So it's confusing whatever logic makes the pull request diff. Try removing the commit from your main branch and opening the PR again from your branch?
Author
Contributor

originally I tried to merge the forked main into this main, but that failed -- that's what I get for not using feature branches :)

originally I tried to merge the forked main into this main, but that failed -- that's what I get for not using feature branches :)
decentral1se added this to the Abra "next" project 2026-01-02 13:09:59 +00:00
decentral1se moved this to Done in Abra "next" on 2026-01-02 13:10:03 +00:00
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: toolshed/abra#735
No description provided.