-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathownlang
executable file
·38 lines (35 loc) · 880 Bytes
/
ownlang
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env sh
(set -o igncr) 2>/dev/null && set -o igncr; # cygwin encoding fix
# resolve links - $0 may be a softlink
PRG="$0"
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`/"$link"
fi
done
PRGDIR=`dirname "$PRG"`
_classpath=".:$PRGDIR/OwnLang.jar"
if [ `uname -a | grep -i -c cygwin` -ne 0 ]; then # Cygwin, translate the path
for k in "$PRGDIR"/modules/*.jar
do
_classpath="${_classpath};`cygpath -w ${k}`"
done
for k in "$PRGDIR"/libs/*.jar
do
_classpath="${_classpath};`cygpath -w ${k}`"
done
else
for k in "$PRGDIR"/modules/*.jar
do
_classpath="${_classpath}:${k}"
done
for k in "$PRGDIR"/libs/*.jar
do
_classpath="${_classpath}:${k}"
done
fi
java -cp "${_classpath}" com.annimon.ownlang.Main "$@"