[Bug] webi is called before it is in the path for some installers
We have a catch-22.
We can't soft-add ~/.local/bin to PATH via an export because then the pathman detection would do the wrong - thinking it's already in the PATH (also see discussion about not using pathman at all when something exists in the PATH)
However, it's also possible to install a meta-package that will use webi when it isn't yet in the PATH.
Solution: we export WEBI_CMD and replace all instances of webi xyz with "${WEBI_CMD}" xyz.
_webi/bootstrap.sh:
+ export WEBI_CMD="$HOME/.local/bin/webi"
- "$HOME/.local/bin/webi" "${WEBI_PKG}"
+ "${WEBI_CMD}" "${WEBI_PKG}"
And then there's a half-dozen places or so where we need to do this:
git-config-gpg/git-config-gpg.sh:
- webi gpg-pubkey
+ "${WEBI_CMD}" gpg-pubkey
Who can take this on?
Anyone that understands the basics of how bash variables work... or who can simply follow those instructions.
${WEBI_CMD:-$HOME/.local/bin/webi} might be better.
i.e. if WEB_CMD is set, use that, else fall back to $HOME/.local/bin/webi
@kaihendry I like that idea. Want to take this on?
@kaihendry bump
Why can't it just update the PATH using envman like mentioned upon https://github.com/webinstall/webi-installers#how-webi-works ?
Sorry, I'm re-interpreting this and the solution proposed is to setup a new ENV variable instead of manipulating the existing PATH ENV variable?
@kaihendry You can only export a variable down to a child process. You can't export it up to a parent.
So we need a way to handle the path of webi whether or not its yet in the the global PATH.
I believe this was fixed a while back.