Skip to content

Commit

Permalink
Merge pull request technomancy#1383 from dannypurcell/msys-classpath-fix
Browse files Browse the repository at this point in the history
Fixes classpath issue under msys
  • Loading branch information
technomancy committed Dec 3, 2013
2 parents f0a31e5 + bd0ff6d commit 1ce5c2f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bin/lein
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function make_native_path {
# ensure we have native paths
if $cygwin && [[ "$1" == /* ]]; then
echo -n "$(cygpath -wp "$1")"
elif [[ "$OSTYPE" == "msys" && "$1" == /* ]]; then
elif [[ "$OSTYPE" == "msys" && "$1" == /?/* ]]; then
echo -n "$(sh -c "(cd $1 2</dev/null && pwd -W) || echo $1 | sed 's/^\\/\([a-z]\)/\\1:/g'")"
else
echo -n "$1"
Expand All @@ -40,7 +40,11 @@ function add_path {
shift
while [ -n "$1" ];do
# http://bashify.com/?Useful_Techniques:Indirect_Variables:Indirect_Assignment
export ${path_var}="${!path_var}${delimiter}$(make_native_path "$1")"
if [[ -z ${!path_var} ]]; then
export ${path_var}="$(make_native_path "$1")"
else
export ${path_var}="${!path_var}${delimiter}$(make_native_path "$1")"
fi
shift
done
}
Expand Down

0 comments on commit 1ce5c2f

Please sign in to comment.