29 | | if [ -r "$BIN_DIR/../src/leiningen/core.clj" ]; then |
30 | | # Running from source checkout |
31 | | LEIN_DIR="$(dirname "$BIN_DIR")" |
32 | | LEIN_LIBS="$(find -H $LEIN_DIR/lib -mindepth 2> /dev/null 1 -maxdepth 1 -print0 | tr \\0 \:)" |
33 | | CLASSPATH="$LEIN_DIR/src:$LEIN_LIBS:$CLASSPATH" |
34 | | |
35 | | if [ "$LEIN_LIBS" = "" -a "$1" != "self-install" ]; then |
36 | | echo "Your Leiningen development checkout is missing its dependencies." |
37 | | echo "Please download a stable version of Leiningen to fetch the deps." |
38 | | echo "See the \"Hacking\" section of the readme for details." |
39 | | exit 1 |
40 | | fi |
41 | | else |
42 | | # Not running from a checkout |
43 | | CLASSPATH="$LEIN_JAR:$CLASSPATH" |
44 | | |
45 | | if [ ! -r "$LEIN_JAR" -a "$1" != "self-install" ]; then |
46 | | echo "Leiningen is not installed. Please run \"lein self-install\"." |
47 | | exit 1 |
48 | | fi |
49 | | fi |
50 | | |
63 | | elif [ "$1" = "self-install" ]; then |
64 | | if [[ $VERSION == *SNAPSHOT ]]; then |
65 | | echo "The self-install task is only meant for stable releases." |
66 | | echo "See the \"Hacking\" section of the README." |
67 | | exit 1 |
68 | | fi |
69 | | echo "Downloading Leiningen now..." |
70 | | mkdir -p `dirname "$LEIN_JAR"` |
71 | | LEIN_URL="http://repo.technomancy.us/leiningen-$VERSION-standalone.jar" |
72 | | if type -p curl >/dev/null 2>&1; then |
73 | | exec curl -o "$LEIN_JAR" "$LEIN_URL" |
74 | | else |
75 | | exec wget -O "$LEIN_JAR" "$LEIN_URL" |
76 | | fi |