Skip to content

Instantly share code, notes, and snippets.

@bolandrm
Last active January 4, 2016 04:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bolandrm/8567103 to your computer and use it in GitHub Desktop.
Save bolandrm/8567103 to your computer and use it in GitHub Desktop.
add ./bin to path if present (for spring)
DEFAULT_PATH=$PATH
# ...
# add ./bin to path for Spring (rails)
add_bin_to_path_if_necessary() {
if [[ -d ./bin ]]; then
export PATH=./bin:$DEFAULT_PATH
else
export PATH=$DEFAULT_PATH
fi
}
# These get run before every command
function precmd() {
add_bin_to_path_if_necessary
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment