-
Notifications
You must be signed in to change notification settings - Fork 50
/
run-cineast-plugin.sh
executable file
·56 lines (47 loc) · 1.25 KB
/
run-cineast-plugin.sh
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
53
54
55
56
#!/usr/bin/env bash
# run-cineast-plugin.sh
# Usage: ./run-cineast-plugin.sh (--api|--runtime) path/to/cineast.jar path/to/plugin.jar
# Constants
API_ENTRY_POINT="org.vitrivr.cineast.api.Main"
RUNTIME_ENTRY_POINT="org.vitrivr.cineast.standalone.Main"
# Variables
ENTRY_POINT=""
CINEAST_JAR=""
PLUGIN_JAR=""
ARGUMENTS=()
# Argument processing
for arg in "$@"; do
case $arg in
-a | --api)
ENTRY_POINT="$API_ENTRY_POINT"
shift
;;
-r | --runtime)
ENTRY_POINT="$RUNTIME_ENTRY_POINT"
shift
;;
-e | --entry-point)
ENTRY_POINT="$2"
shift
shift
;;
*)
ARGUMENTS+=("$1")
shift
;;
esac
done
if [ -z "$ENTRY_POINT" ]; then
echo "No entry point specified! Please specify if you are using the Cineast CLI (--api) or the Cineast Runtime (--runtime)."
exit 1
fi
if [ ${#ARGUMENTS[@]} -lt 2 ]; then
echo "Not enough arguments specified! Please specify path/to/cineast.jar and path/to/plugin.jar."
exit 1
fi
#echo "Entry point: $ENTRY_POINT"
#echo "Additional args (${#ARGUMENTS[@]}): ${ARGUMENTS[*]}"
CINEAST_JAR="${ARGUMENTS[0]}"
PLUGIN_JAR="${ARGUMENTS[1]}"
echo "java -classpath $CINEAST_JAR:$PLUGIN_JAR $ENTRY_POINT ${ARGUMENTS[*]:2}"
java -classpath "$CINEAST_JAR:$PLUGIN_JAR" "$ENTRY_POINT" "${ARGUMENTS[@]:2}"