Running a dev version of lein from a checkout shouldn't use LEIN_JAR.

Improve error message when dev checkout deps are missing.

Store uberjar in ~/.m2 as -standalone in order to avoid ambiguity.
This commit is contained in:
Phil Hagelberg 2009-11-27 20:27:11 -08:00
parent 173da8ee74
commit 2a76567d9e
2 changed files with 12 additions and 9 deletions

View file

@ -1,10 +1,9 @@
#!/bin/bash
# TODO: this gives us a trailing colon
VERSION="1.0.0-SNAPSHOT"
LIBS="$(find -H lib/ -mindepth 2> /dev/null 1 -maxdepth 1 -print0 | tr \\0 \:)"
CLASSPATH="src/:classes/:$LIBS"
LEIN_JAR=$HOME/.m2/repository/leiningen/leiningen/$VERSION/leiningen-$VERSION.jar
LEIN_JAR=$HOME/.m2/repository/leiningen/leiningen/$VERSION/leiningen-$VERSION-standalone.jar
# normalize $0 on certain BSDs
if [ "$(dirname $0)" = "." ]; then
@ -29,10 +28,14 @@ BIN_DIR="$(dirname "$SCRIPT")"
if [ -r "$BIN_DIR/../src/leiningen/core.clj" ]; then
# Running from source checkout
LEIN_DIR="$(dirname "$BIN_DIR")"
CLASSPATH="$LEIN_DIR/src:$LEIN_DIR/classes:$LEIN_DIR/lib:$LEIN_JAR:$CLASSPATH"
LEIN_LIBS="$(find -H $LEIN_DIR/lib/ -mindepth 2> /dev/null 1 -maxdepth 1 -print0 | tr \\0 \:)"
CLASSPATH="$LEIN_DIR/src:$LEIN_LIBS:$CLASSPATH"
if [ ! -r "lib/leiningen*jar" -a ! -r "$LEIN_JAR" -a "$1" != "self-install" ]; then
echo "Leiningen is not installed. Please run \"lein self-install\"."
if [ "$LEIN_LIBS" = "" -a "$1" != "self-install" ]; then
echo "Your Leiningen development checkout is missing its dependencies."
echo "Please download a stable version of Leiningen to fetch the deps."
echo "See the \"Hacking\" section of the readme for details."
exit 1
fi
else
# Not running from a checkout
@ -65,7 +68,7 @@ if [ "$1" = "repl" ]; then
elif [ "$1" = "self-install" ]; then
echo "Downloading Leiningen now..."
mkdir -p `dirname "$LEIN_JAR"`
LEIN_URL=http://repo.technomancy.us/leiningen-$VERSION.jar
LEIN_URL="http://repo.technomancy.us/leiningen-$VERSION-standalone.jar"
if type -p curl >/dev/null 2>&1; then
exec curl -o "$LEIN_JAR" "$LEIN_URL"
else

View file

@ -7,9 +7,9 @@ Leiningen TODOs
* For 1.0
** TODO Remove install task dependency on having Maven installed :Phil:
** TODO Use -Xbootclasspath where possible
** DONE Don't write manifest, pom, etc. to disk when jarring :Dan:
** TODO Don't put uberjar in ~/.m2
** TODO Use -Xbootclasspath where possible :Dan:
** DONE Don't write manifest, pom, etc. to disk when jarring :Dan:
** DONE Don't put uberjar in ~/.m2 :Phil:
** TODO Perform compilation in either a subprocess or with a separate classloader
** TODO Allow test task to take namespaces as an argument
** TODO System/exit appropriately when testing based on pass/fail