Ticket #22720: patch-bin-lein.diff

File patch-bin-lein.diff, 1.4 KB (added by ian.eure@…, 15 years ago)
  • bin/lein

    diff --git a/bin/lein b/bin/lein
    index 92546b1..a90c43f 100755
    a b  
    22
    33# TODO: this gives us a trailing colon
    44VERSION=0.5.0
    5 LIBS="$(find -H lib/ -mindepth 2> /dev/null 1 -maxdepth 1 -print0 | tr \\0 \:)"
     5PREFIX=__PREFIX__
     6LIBS="$(find -H $PREFIX -name \*.jar -print0 | tr \\0 \:)"
    67CLASSPATH="src/:classes/:$LIBS"
    7 LEIN_JAR=$HOME/.m2/repository/leiningen/leiningen/$VERSION/leiningen-$VERSION.jar
    88
    99# this needs to exist before the JVM is launched apparently
    1010mkdir -p classes
    1111
    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 
    2212if [ "$1" = "test" ]; then
    2313    CLASSPATH=test/:$CLASSPATH
    2414fi
    fi 
    3727if [ "$1" = "repl" ]; then
    3828    # If repl used leiningen.core then there'd be no way to bootstrap AOT
    3929    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
    4930else
    5031    if [ -z "$1" ]; then
    5132        echo "$0 missing task"