devops-works / binenv

One binary to rule them all. Manage all those pesky binaries (kubectl, helm, terraform, ...) easily.
MIT License
366 stars 44 forks source link

BinEnv is unable to find binaries in global mode. #227

Closed heavyblack1 closed 1 year ago

heavyblack1 commented 1 year ago

I installed binenv according to your system-wide installation instructions. And also add echo "export BINENV_GLOBAL=true" >> .bashrc and exec $SHELL.

I tried running sudo bat, and it didn't work.

2023-02-07T12:41:26+01:00 INF updating distribution list
2023-02-07T12:41:26+01:00 ERR no versions found for distribution "bat" (from bat). Something is really odd.
2023-02-07T12:41:26+01:00 FTL binenv: unable to find proper version for bat ()

After some digging, I returned from system-wide installation to the main readme.md and found the missing answer to my problem.

sudo env "PATH=$PATH" "HOME=$HOME" bat

2023-02-07T13:04:15+01:00 ERR no versions found for distribution "bat" (from bat). Something is really odd.
2023-02-07T13:04:15+01:00 FTL binenv: unable to find proper version for bat ()

But even this didn't solve issue.

Is this a bug? Or I didn't understand your guide?

Thanks for help

leucos commented 1 year ago

Can you confirm that bat installaion went well with binenv install -g bat ?

Did you try sudo env "PATH=$PATH" "HOME=$HOME" "BINENV_GLOBAL=true" bat ?

Could you also try sudo -E bat also ?

heavyblack1 commented 1 year ago

I looked in to history. Yes i specified -g option.  This command work

sudo env "PATH=$PATH" "HOME=$HOME" "BINENV_GLOBAL=true" bat ./binenv_install.sh

Even this worked

sudo "BINENV_GLOBAL=true" bat ./binenv_install.sh

This also worked

sudo -E bat ./binenv_install.sh

Should I put this into alias into .bashrc or is there something easier?

Thanks for your time

leucos commented 1 year ago

Thanks a lot for the report. This is now solved in v0.19.8.