File tree Expand file tree Collapse file tree 3 files changed +32
-18
lines changed Expand file tree Collapse file tree 3 files changed +32
-18
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env sh
2
2
ROOT=" $( pwd) "
3
- VERSION=" 1.1.4 "
3
+ VERSION=" 1.1.6 "
4
4
cd " $( dirname " $0 " ) " || exit
5
5
cd " ../"
6
+ # Navigate to the root directory
6
7
cd " $ROOT " || exit
8
+
9
+ # Java options initialization
7
10
JAVA_OPTS=" "
11
+
12
+ # Arguments initialization
8
13
args=" "
9
- for arg
10
- do
11
- str=$( echo " $arg " | awk ' { string=substr($0, 0, 2); print string; }' )
12
- if [ " $str " = " -D" -o " $str " = " -X" ]
13
- then
14
- JAVA_OPTS=$JAVA_OPTS " " $arg
15
- else
16
- args=$args " " $arg
17
- fi
14
+
15
+ # Loop through each argument
16
+ for arg; do
17
+ # Extract the first two characters of the argument
18
+ str=${arg: 0: 2}
19
+
20
+ # Check if it starts with '-D' or '-X'
21
+ if [ " $str " = " -D" ] || [ " $str " = " -X" ]; then
22
+ JAVA_OPTS=" $JAVA_OPTS $arg "
23
+ else
24
+ args=" $args $arg "
25
+ fi
18
26
done
27
+
28
+ # Check if the JAR file exists
19
29
JAR_FILE=" $ROOT /lib/tinystruct-$VERSION -jar-with-dependencies.jar"
20
- if [ ! -f " $JAR_FILE " ]; then
21
- JAR_FILE=" "
22
- else
23
- JAR_FILE=$JAR_FILE " :"
24
- fi
30
+ [ -f " $JAR_FILE " ] && JAR_FILE=" $JAR_FILE :"
31
+
32
+ # Check if additional JAR files exist and add them to the classpath
33
+ # shellcheck disable=SC2043
34
+ for jar_file in " $ROOT " /lib/tinystruct-" $VERSION " .jar; do
35
+ [ -f " $jar_file " ] && JAR_FILE=" $JAR_FILE$jar_file :"
36
+ done
37
+
38
+ # Java execution
25
39
java \
26
40
$JAVA_OPTS \
27
41
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp/ \
Original file line number Diff line number Diff line change 15
15
@ rem ***************************************************************************
16
16
@ echo off
17
17
set " ROOT = %~dp0 ..\"
18
- set " VERSION = 1.1.4 "
18
+ set " VERSION = 1.1.6 "
19
19
set " classpath = %ROOT% target\classes:%ROOT% lib\*:%ROOT% WEB-INF\lib\*:%ROOT% WEB-INF\classes" :%classpath%
20
20
@ java -cp " %ROOT% target\classes;%ROOT% lib\tinystruct-%VERSION% -jar-with-dependencies.jar;%ROOT% lib\*;%ROOT% WEB-INF\lib\*;%ROOT% WEB-INF\classes;%USERPROFILE% \.m2\repository\org\tinystruct\tinystruct\%VERSION% \tinystruct-%VERSION% -jar-with-dependencies.jar" org.tinystruct.system.Dispatcher %*
Original file line number Diff line number Diff line change 21
21
<dependency >
22
22
<groupId >org.tinystruct</groupId >
23
23
<artifactId >tinystruct</artifactId >
24
- <version >1.1.4 </version >
25
- <classifier >jar-with-dependencies</classifier >
24
+ <version >1.1.6 </version >
25
+ <!-- <classifier>jar-with-dependencies</classifier> -- >
26
26
</dependency >
27
27
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-simple -->
28
28
<dependency >
You can’t perform that action at this time.
0 commit comments