-
Notifications
You must be signed in to change notification settings - Fork 0
/
robot
executable file
·37 lines (31 loc) · 964 Bytes
/
robot
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
#!/bin/sh
# https://raw.githubusercontent.com/ontodev/robot/master/bin/robot
## Check for Cygwin, use grep for a case-insensitive search
IS_CYGWIN="FALSE"
if uname | grep -iq cygwin; then
IS_CYGWIN="TRUE"
fi
# Variable to hold path to this script
# Start by assuming it was the path invoked.
ROBOT_SCRIPT="$0"
# Handle resolving symlinks to this script.
# Using ls instead of readlink, because bsd and gnu flavors
# have different behavior.
while [ -h "$ROBOT_SCRIPT" ] ; do
ls=`ls -ld "$ROBOT_SCRIPT"`
# Drop everything prior to ->
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
ROBOT_SCRIPT="$link"
else
ROBOT_SCRIPT=`dirname "$ROBOT_SCRIPT"`/"$link"
fi
done
# Directory that contains the this script
DIR=$(dirname "$ROBOT_SCRIPT")
if [ $IS_CYGWIN = "TRUE" ]
then
exec java $ROBOT_JAVA_ARGS -jar "$(cygpath -w $DIR/robot.jar)" "$@"
else
exec java $ROBOT_JAVA_ARGS -jar "$DIR/robot.jar" "$@"
fi