marcosnils / bin

Effortless binary manager
MIT License
648 stars 45 forks source link

bin does not have default download dir by default #107

Closed walidshaari closed 2 years ago

walidshaari commented 2 years ago

Tried this at fedora and Ubuntu, OS is not a factor, did try it with an old release 0.6, same issue

./bin_0.8.0_Linux_x86_64 install github.com/marcosnils/bin

Pick a default download dir: 

 Select an option: 
Invalid option
marcosnils commented 2 years ago

hey @walidshaari!

can you please add the debug flag to bin and paste the output here?

bin tries to suggest a default download dir on *nix systems based on the PATH dirs that it finds and checking if the current user that's executing bin can actually write there. Do you have your PATH variable set?

Apart from improving the error message, imagine that bin can't find any directory automatically that can be used. What would you've liked to have done to configure it?

walidshaari commented 2 years ago

I solved it by using sudo, and copying the config.json file from /root to user home dir and changing it. here is the debug file if It is freshly installed

tester@vm01:~$ /tmp/bin_0.8.0_Linux_x86_64 --debug install https://github.com/marcosnils/bin
   • debug logs enabled       
   • Config directory is: /home/tester/.bin
   • User PATH is [/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin]
   • Checking path /usr/local/sbin
   • Error [permission denied] checking path
   • Checking path /usr/local/bin
   • Error [permission denied] checking path
   • Checking path /usr/sbin  
   • Error [permission denied] checking path
   • Checking path /usr/bin   
   • Error [permission denied] checking path
   • Checking path /sbin      
   • Error [permission denied] checking path
   • Checking path /bin       
   • Error [permission denied] checking path
   • Checking path /usr/games 
   • Error [permission denied] checking path
   • Checking path /usr/local/games
   • Error [permission denied] checking path
   • Checking path /snap/bin  
   • Error [permission denied] checking path

Pick a default download dir: 

 Select an option: 
Invalid option
 Select an option: 1
Invalid option
 Select an option: 2
Invalid option
 Select an option: 0
Invalid option
 Select an option: 
walidshaari commented 2 years ago

adding a directory to the list of paths above as in export PATH=/home/tester/.bin:$PATH solves it

frezbo commented 2 years ago

@walidshaari on a fresh os install I had ~/.local/bin in the PATH, but ~/.local/bin folder was missing, hence bin couldn't find any directory it can write.

Fix is to do mkdir -p ~/.local/bin

marcosnils commented 2 years ago

Fixed in #108