Many of you have probably already had this discussion already and made a conscious decision to do this, but I do not understand why the decision was made, and would like to get guidance on how best to make this work across the board for our development environment.
We are observing that when using boxen the relative directory "bin" is prepended to my PATH. This causes challenges for us, because:
- we put some software already in $HOME/bin that is relative to our environment
This is problematic because the results from a PATH lookup are cached in shells. For a quick example, create a new file in ~/bin, called test_relative_path with the following contents:
#!/usr/bin/env bash
echo "it works!"
set the executable bit on this file, and then open up a new shell in Terminal, and you will
observe the following:
[huckphin@MBAir ~]$ test_relative_path
it works!
[huckphin@MBAir ~]$ which test_relative_path
bin/test_relative_path
[huckphin@MBAir ~]$ cd /tmp
[huckphin@MBAir tmp]$ test_relative_path
-bash: bin/test_relative_path: No such file or directory
It cannot find the file that was found because Boxen prepends the relative path, and the first one found
is cached. The file that prepends the relative directory to the PATH is found in this file: https://github.com/boxen/puppet-boxen/blob/master/files/relative_bin_on_path.sh
Is there a better way that this problem can be solved so that a relative directory is not added to our PATH? I would like to submit a PR that will change it to include $HOME/bin instead of bin, but I would like to open it up for a discussion to see I can understand what problem this was trying to solve.
I know that you can override this default behavior by adding the following in your bashrc:
but it seems a little weird to have the users be forced to set this option if they want to run Boxen.