diff --git a/bin/lein b/bin/lein
index 92546b1..a90c43f 100755
a
|
b
|
|
2 | 2 | |
3 | 3 | # TODO: this gives us a trailing colon |
4 | 4 | VERSION=0.5.0 |
5 | | LIBS="$(find -H lib/ -mindepth 2> /dev/null 1 -maxdepth 1 -print0 | tr \\0 \:)" |
| 5 | PREFIX=__PREFIX__ |
| 6 | LIBS="$(find -H $PREFIX -name \*.jar -print0 | tr \\0 \:)" |
6 | 7 | CLASSPATH="src/:classes/:$LIBS" |
7 | | LEIN_JAR=$HOME/.m2/repository/leiningen/leiningen/$VERSION/leiningen-$VERSION.jar |
8 | 8 | |
9 | 9 | # this needs to exist before the JVM is launched apparently |
10 | 10 | mkdir -p classes |
11 | 11 | |
12 | | # If we are not running from a checkout |
13 | | if [ ! -r "bin/lein" ]; then |
14 | | if [ ! -r "$LEIN_JAR" -a "$1" != "self-install" ]; then |
15 | | echo "Leiningen is not installed. Please run \"lein self-install\"." |
16 | | exit 1 |
17 | | fi |
18 | | |
19 | | CLASSPATH="$CLASSPATH:$LEIN_JAR" |
20 | | fi |
21 | | |
22 | 12 | if [ "$1" = "test" ]; then |
23 | 13 | CLASSPATH=test/:$CLASSPATH |
24 | 14 | fi |
… |
… |
fi |
37 | 27 | if [ "$1" = "repl" ]; then |
38 | 28 | # If repl used leiningen.core then there'd be no way to bootstrap AOT |
39 | 29 | java -cp "$CLASSPATH" clojure.main |
40 | | elif [ "$1" = "self-install" ]; then |
41 | | echo "Downloading Leiningen now..." |
42 | | mkdir -p `dirname "$LEIN_JAR"` |
43 | | LEIN_URL=http://repo.technomancy.us/leiningen-$VERSION.jar |
44 | | if type -p curl >/dev/null 2>&1; then |
45 | | exec curl -o "$LEIN_JAR" "$LEIN_URL" |
46 | | else |
47 | | exec wget -O "$LEIN_JAR" "$LEIN_URL" |
48 | | fi |
49 | 30 | else |
50 | 31 | if [ -z "$1" ]; then |
51 | 32 | echo "$0 missing task" |