diff --git a/shell/_main.sh b/shell/_main.sh old mode 100644 new mode 100755 diff --git a/shell/env.sh b/shell/env.sh index 6af5135..3ec61cf 100644 --- a/shell/env.sh +++ b/shell/env.sh @@ -29,10 +29,6 @@ path_prepend "$HOME/bin" # Add dotfiles' bin directory to PATH path_prepend "$DOTBIN" -# Relative Paths - must be first in PATH -path_append "./node_modules/.bin" # Node.js -path_append "./vendor/bundle/bin" # Ruby Bundler - # Ensure TMPDIR is the same for local and remote ssh logins if [[ $TMPDIR == "/var/folders/"* ]] || [[ $TMPDIR == "" ]]; then export TMPDIR="/tmp/user-$USER" diff --git a/shell/golang.sh b/shell/golang.sh old mode 100644 new mode 100755 index 07ce7dc..373381e --- a/shell/golang.sh +++ b/shell/golang.sh @@ -2,5 +2,27 @@ # Go (golang) environment setup. # -export GOPATH="$HOME/.go" -path_append "$GOPATH/bin" +export GOPATH="$HOME/.go:$HOME/Projects/Go" +path_prepend "$HOME/Projects/Go/bin:$HOME/.go/bin" + +install_go_global_packages () { + local packages=( + github.com/golang/lint/golint \ + github.com/kisielk/errcheck \ + github.com/kr/pretty \ + github.com/laher/goxc \ + github.com/mdempsky/unconvert \ + github.com/motemen/gore \ + github.com/nsf/gocode \ + github.com/pmezard/go-difflib/difflib \ + github.com/rogpeppe/godef \ + github.com/tools/godep \ + golang.org/x/tools/cmd/goimports \ + launchpad.net/gorun \ + ) + + for package in "${packages[@]}"; do + echo "installing/updating \"$package\"" + go get -u "$package" + done +} diff --git a/shell/nodejs.sh b/shell/nodejs.sh index 0f124f5..9a50862 100644 --- a/shell/nodejs.sh +++ b/shell/nodejs.sh @@ -37,7 +37,7 @@ if [ -f "$HOME/.nvm/nvm.sh" ]; then source "$HOME/.nvm/nvm.sh" # And it's shell completion - if [ -f "$HOME/.nvm/bash_completion" ]; then + if [ -n "$BASH_VERSION" ] && [ -f "$HOME/.nvm/bash_completion" ]; then source "$HOME/.nvm/bash_completion" fi fi diff --git a/shell/ruby.sh b/shell/ruby.sh old mode 100644 new mode 100755 index 197b9f6..67025b7 --- a/shell/ruby.sh +++ b/shell/ruby.sh @@ -1,3 +1,7 @@ +# +# Ruby environment setup. +# + # Aliases alias po="powify" alias lu="lunchy" @@ -33,16 +37,19 @@ fi # Load rbenv or RVM depending on which is available if [ -d "$HOME/.rbenv/bin" ]; then path_prepend "$HOME/.rbenv/bin" - path_prepend "$HOME/.rbenv/shims" + # if [[ ":$PATH:" != *":$HOME/.rbenv/shims:"* ]]; then eval "$(rbenv init -)" + # fi elif [ -s "$HOME/.rvm/scripts/rvm" ]; then source "$HOME/.rvm/scripts/rvm" fi # lunchy auto-completion -LUNCHY_DIR="$(dirname `gem which lunchy`)/../extras" -if [ -n "$BASH_VERSION" ] && [ -f "$LUNCHY_DIR/lunchy-completion.bash" ]; then - source "$LUNCHY_DIR/lunchy-completion.bash" -elif [ -n "$ZSH_VERSION" ] && [ -f "$LUNCHY_DIR/lunchy-completion.zsh" ]; then - source "$LUNCHY_DIR/lunchy-completion.zsh" +if [ -n "$BASH_VERSION" ]; then + if which gem &> /dev/null && gem which lunchy &> /dev/null; then + LUNCHY_DIR="$(dirname "$(gem which lunchy)")/../extras" + if [ -f "$LUNCHY_DIR/lunchy-completion.bash" ]; then + source "$LUNCHY_DIR/lunchy-completion.bash" + fi + fi fi