Ticket #17498: clj-jline.sh

File clj-jline.sh, 525 bytes (added by mpdippery@…, 16 years ago)

JLine-enabled launcher script

Line 
1#!/bin/sh
2
3# clj - Clojure launcher script
4
5
6cljjar='lib/clojure.jar'
7cljclass='clojure.lang.Repl'
8jlineclass='jline.ConsoleRunner'
9
10dir=$0
11while [ -h "$dir" ]; do
12    ls=`ls -ld "$dir"`
13    link=`expr "$ls" : '.*-> \(.*\)$'`
14
15    if expr "$link" : '/.*' > /dev/null; then
16        dir="$link"
17    else
18        dir=`dirname "$dir"`"/$link"
19    fi
20done
21
22dir=`dirname $dir`
23dir=`cd "$dir" > /dev/null && pwd`
24cljjar="$dir/../$cljjar"
25jlinejar="$dir/../../jline.jar"
26
27exec java -classpath $jlinejar:$cljjar $jlineclass $cljclass