-
Notifications
You must be signed in to change notification settings - Fork 1
/
abcl
executable file
·52 lines (43 loc) · 1.13 KB
/
abcl
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh
# Place the script to the root path of ABCL.
# Check whether Java is available.
if ! command -v java -version 2>/dev/null 1>&2;
then
echo "No Java on the system" >&2;
exit 1;
fi
# Locate the path of the script itself.
root=$(dirname "$0");
# Check whether ABCL is available.
if ! [ -f "$root/abcl.jar" ];
then
echo "No ABCL on the system" >&2;
exit 1;
fi
# Check whether ABCL contrib JAR is available.
if [ -f "$root/abcl-contrib.jar" ];
then
require_abcl_contrib="--eval \"(require :abcl-contrib)\"";
else
require_abcl_contrib="";
echo "No ABCL contrib JAR on the system" >&2;
# ABCL contrib JAR is not a mandatory part of ABCL.
# Hence, we don't exit the wrapper.
fi
# Check whether rlwrap is available.
if command -v rlwrap --version 2>/dev/null 1>&2;
then
RUN_RLWRAP=rlwrap;
else
RUN_RLWRAP=;
fi
# Check whether some Lisp script is available.
script=$1;
if [ -f "$script" ];
then
# Consume the first argument, which is $script.
shift;
java -jar "$root/abcl.jar" --noinform "$require_abcl_contrib" --load "$script" -- "$@";
else
$RUN_RLWRAP java -jar "$root/abcl.jar" "$require_abcl_contrib" "$@";
fi