whalebrew/whalebrew

Make it work as non-admin

magnusviri opened this issue · 3 comments

I am logged in as a non-admin user. If I try to whalebrew install something it fails to create the file in /usr/local/bin. Can you add an option to install it in the cwd or something?

Hi!
Thanks for raising.
Indeed, the default installation path is /usr/local/bin but you can configure this path using the WHALEBREW_INSTALL_PATH environment variable.

Note that doing so, you will need to also update your PATH so you can run the installed packages: export PATH=${PATH}:${WHALEBREW_INSTALL_PATH}

Would that solve your problem?

Setting WHALEBREW_INSTALL_PATH works, but I think it's not the best solution. Could whalebrew install into the Homebrew directory by default? That is, use Homebrew's HOMEBREW_PREFIX and append /bin.

For example, my HOMEBREW_PREFIX is set to /Users/lsloan/homebrew, so things get installed in the bin subdirectory there. whalebrew is installed as /Users/lsloan/homebrew/bin/whalebrew. If whalebrew could then install things there, that'd be perfect. The Homebrew bin directory is already in my path, so there's no need to worry about changing that.

As a proof of concept, I tried it like this…

$ WHALEBREW_INSTALL_PATH=`brew --prefix`'/bin' whalebrew install whalebrew/whalesay
🐳  Installed whalebrew/whalesay to /Users/lsloan/homebrew/bin/whalesay
$ whalesay FUBAR
 _______
< FUBAR >
 -------
    \
     \
      \
                    ##         .
              ## ## ##        ==
           ## ## ## ## ##    ===
       /"""""""""""""""""\___/ ===
  ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~
       \______ o           __/
         \    \         __/
          \____\_______/

I'm having similar problems overriding the install path due to homebrew changes on Apple Silicon and WHALEBREW_INSTALL_PATH not working with brew bundle.

I've made some suggestions open for comment here #191