Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make loading order for PATH correct, add npm to cygwin path

  • Loading branch information...
commit e404add89bd33d0b3e8afb0ea8393cc39b7b03b9 1 parent 38e0dc1
@weikinhuang authored
Showing with 17 additions and 14 deletions.
  1. +14 −14 .bashrc
  2. +3 −0  .dotenv/cygwin/.env
View
28 .bashrc
@@ -21,8 +21,8 @@ esac
# Check out which env this bash is running in
DOTENV="linux"
case "$(uname -s)" in
- CYGWIN* )
- DOTENV="cygwin"
+ CYGWIN* )
+ DOTENV="cygwin"
;;
MINGW32_NT* )
# we'll just pretend to use the cygwin functions
@@ -34,8 +34,8 @@ case "$(uname -s)" in
BASH='/bin/bash'
fi
;;
- Darwin )
- DOTENV="darwin"
+ Darwin )
+ DOTENV="darwin"
;;
esac
export DOTENV
@@ -46,16 +46,6 @@ export DOTENV
# Completion options
[[ -f "/etc/bash_completion" ]] && source "/etc/bash_completion"
-# Source ~/.exports, ~/.functions, ~/.aliases, ~/.completion, ~/.prompt, ~/.extra, ~/.env if they exist
-for file in {exports,functions,aliases,completion,prompt,extra,env}; do
- [[ -r "${HOME}/.dotenv/.${file}" ]] && source "${HOME}/.dotenv/.${file}"
- [[ -r "${HOME}/.dotenv/${DOTENV}/.${file}" ]] && source "${HOME}/.dotenv/${DOTENV}/.${file}"
-done
-unset file
-
-# load a local specific sources before the scripts
-[[ -r "${HOME}/.bash_local" ]] && source "${HOME}/.bash_local"
-
# modify path to include useful scripts
[[ -d "${HOME}/.dotenv/${DOTENV}/bin" ]] && PATH="$PATH:${HOME}/.dotenv/${DOTENV}/bin"
[[ -d "${HOME}/.dotenv/bin" ]] && PATH="$PATH:${HOME}/.dotenv/bin"
@@ -66,6 +56,16 @@ if type nl &> /dev/null; then
export PATH=$(echo "$PATH" | tr : '\n' | nl | sort -u -k 2,2 | sort -n | cut -f 2- | tr '\n' : | sed -e 's/:$//' -e 's/^://')
fi
+# Source ~/.exports, ~/.functions, ~/.aliases, ~/.completion, ~/.prompt, ~/.extra, ~/.env if they exist
+for file in {exports,functions,aliases,completion,prompt,extra,env}; do
+ [[ -r "${HOME}/.dotenv/.${file}" ]] && source "${HOME}/.dotenv/.${file}"
+ [[ -r "${HOME}/.dotenv/${DOTENV}/.${file}" ]] && source "${HOME}/.dotenv/${DOTENV}/.${file}"
+done
+unset file
+
+# load a local specific sources before the scripts
+[[ -r "${HOME}/.bash_local" ]] && source "${HOME}/.bash_local"
+
# include utility settings file (git PS1, solarized, mysql, etc...)
[[ -r "${HOME}/.dotenv/.utility" ]] && source "${HOME}/.dotenv/.utility"
View
3  .dotenv/cygwin/.env
@@ -15,5 +15,8 @@ fi
# Remove the windows version of node from the path so we can use the wrapped version
PATH=$(echo "$PATH" | sed "s/\/c\/Program Files\/nodejs:\?//")
+# add npmjs to path if possible
+[[ -d "/c/Users/$USER/AppData/Roaming/npm" ]] && PATH="$PATH:/c/Users/$USER/AppData/Roaming/npm/"
+
# redirect to Documents folder if starting in home
[[ "$(pwd)" == "${HOME}" ]] && [[ -d "${HOME}/Documents" ]] && cd "${HOME}/Documents"
Please sign in to comment.
Something went wrong with that request. Please try again.