Ticket #19798: clj-jline.patch

File clj-jline.patch, 1.1 KB (added by mdippery@…, 15 years ago)

Patch for clj-jline.sh

  • clj-jline.sh

    old new  
    1010
    1111dir=$0
    1212while [ -h "$dir" ]; do
    13     ls=`ls -ld "$dir"`
    14     link=`expr "$ls" : '.*-> \(.*\)$'`
     13  ls=`ls -ld "$dir"`
     14  link=`expr "$ls" : '.*-> \(.*\)$'`
    1515
    16     if expr "$link" : '/.*' > /dev/null; then
    17         dir="$link"
    18     else
    19         dir=`dirname "$dir"`"/$link"
    20     fi
     16  if expr "$link" : '/.*' > /dev/null; then
     17    dir="$link"
     18  else
     19    dir=`dirname "$dir"`"/$link"
     20  fi
    2121done
    2222
    2323dir=`dirname $dir`
    2424dir=`cd "$dir" > /dev/null && pwd`
    2525cljjar="$dir/../$cljjar"
    2626jlinejar="$dir/../../jline.jar"
     27cp="${PWD}:${jlinejar}:${cljjar}"
    2728
     29# Add extra jars as specified by `.clojure` file
     30# Borrowed from <http://github.com/mreid/clojure-framework>
     31if [ -f .clojure ]; then
     32  cp=$cp:`cat .clojure`
     33fi
    2834
    2935if [ -z "$1" ]; then
    30   exec java -classpath $jlinejar:$cljjar $jlineclass $cljclass
     36  exec java -classpath $cp $jlineclass $cljclass
    3137else
    3238  scriptname=$1
    33   exec java -classpath $jlinejar:$cljjar $jlineclass $cljscript $scriptname --$*
     39  exec java -classpath $cp $jlineclass $cljscript $scriptname --$*
    3440fi
    35