-
Notifications
You must be signed in to change notification settings - Fork 0
/
restore.sh
42 lines (34 loc) · 1.04 KB
/
restore.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
#!/bin/bash
# Set the base directory where this script is located
BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Initialize optional arguments
PREVIEW=false
CONFIG_FILE=""
# Create a classpath variable to include all JARs in the lib folder
CLASSPATH="${BASEDIR}/../lib/*"
# Parse command line arguments
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
--preview)
PREVIEW=true
;;
*)
CONFIG_FILE="$1"
;;
esac
shift
done
# Check if a configuration file is provided
if [ -z "$CONFIG_FILE" ]; then
echo "Error: Please specify the application configuration file."
exit 1
fi
# Add optional logic for handling the --preview flag
if [ "$PREVIEW" = true ]; then
echo "Running the application in preview mode with configuration file: $CONFIG_FILE"
java -cp "$CLASSPATH" io.lenses.App --config "$CONFIG_FILE" --preview
else
echo "Running the application with configuration file: $CONFIG_FILE"
java -cp "$CLASSPATH" io.lenses.App --config "$CONFIG_FILE"
fi