Skip to content

Instantly share code, notes, and snippets.

@155martinmoreno
Last active September 10, 2015 15:43
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 155martinmoreno/b0cb541a346d74cf67e6 to your computer and use it in GitHub Desktop.
Save 155martinmoreno/b0cb541a346d74cf67e6 to your computer and use it in GitHub Desktop.
A more useful .bash_profile
function setjdk() {
if [ $# -ne 0 ]; then
removeFromPath '/System/Library/Frameworks/JavaVM.framework/Home/bin'
if [ -n "${JAVA_HOME+x}" ]; then
removeFromPath $JAVA_HOME
fi
export JAVA_HOME=`/usr/libexec/java_home -v $@`
export PATH=$JAVA_HOME/bin:$PATH
fi
}
function removeFromPath() {
export PATH=$(echo $PATH | sed -E -e "s;:$1;;" -e "s;$1:?;;")
}
//Java
setjdk 1.7
//Android SDK
//Android SDK
export ANDROID_HOME=/Users/martinmoreno/SDKs/android
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/build-tools/22.0.1
//Git
export PATH=/usr/local/git/bin:$PATH
//Mongo
export PATH=~/Applications/mongodb-osx-x86_64-2.6.4/bin:$PATH
//Go
export GOPATH=/Users/martinmoreno/Projects/go
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOBIN
//Gradle
export PATH=$PATH:/Users/martinmoreno/SDKs/gradle-2.1/bin
//Python
# Setting PATH for Python 3.5
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}"
export PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment