Created
December 1, 2011 12:30
-
-
Save hartsock/1416383 to your computer and use it in GitHub Desktop.
automatically add the tool to your path
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# which programs do you want to install into your path? | |
programs=( groovy grails gradle scala ) | |
# relies on the conventions: | |
# 1. all tools go into ~/tools | |
# 2. all tools are configured with a 'current' symlink for | |
# the currently in-use version | |
# 3. all tools have a 'bin' directory | |
# 4. call this from your .bashrc or .profile or whatever | |
# for example: to upgrade from grails 1.3.6 to 1.3.7 | |
# $ cd ~/tools/grails | |
# $ rm current | |
# $ ln -s grails-1.3.7 current | |
for program in "${programs[@]}" | |
do | |
bindir="$HOME/tools/$program/current/bin" | |
if [ -d "$bindir" ]; then | |
PATH="$bindir:$PATH" | |
fi | |
done | |
export PATH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment