warrensbox/terraform-switcher

Fallback to ~/bin if /usr/local/bin doesn't exist

Closed this issue · 1 comments

Please add an additional check if folder /usr/local/bin exists and if not - fall back to ~/bin folder, as expected. I'm using nixOS and /usr/local/bin doesn't exist there. The output is:

[Error] : Binary path does not exist: /usr/local/bin/terraform
[Error] : Manually create bin directory at: /usr/local/bin and try again.

Instead after creating this folder as root (I don't want to use this folder):

Unable to write to: /usr/local/bin/terraform
Creating bin directory at: /home/usr/bin
Creating directory for terraform binary at: /home/usr/bin
RUN `export PATH=$PATH:/home/usr/bin` to append bin to $PATH

That would be much appreciated.