Skip to content

Commit c736fcd

Browse files
committed
Fix MySQL data update issue through upgrade the tinystruct version to be 1.2.2.
1 parent 82815b9 commit c736fcd

File tree

3 files changed

+28
-7
lines changed

3 files changed

+28
-7
lines changed

bin/dispatcher

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env sh
22
ROOT="$(pwd)"
3-
VERSION="1.2.1"
3+
VERSION="1.2.2"
44
cd "$(dirname "$0")" || exit
55
cd "../"
66
# Navigate to the root directory
@@ -15,7 +15,8 @@ args=""
1515
# Loop through each argument
1616
for arg; do
1717
# Extract the first two characters of the argument
18-
str=${arg:0:2}
18+
# str=${arg:0:2}
19+
str=$(echo "$arg" | awk '{ string=substr($0, 0, 2); print string; }' )
1920

2021
# Check if it starts with '-D' or '-X'
2122
if [ "$str" = "-D" ] || [ "$str" = "-X" ]; then

bin/dispatcher.cmd

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@rem ***************************************************************************
2-
@rem Copyright (c) 2017 James Mover Zhou
2+
@rem Copyright (c) 2023 James Mover Zhou
33
@rem
44
@rem Licensed under the Apache License, Version 2.0 (the "License");
55
@rem you may not use this file except in compliance with the License.
@@ -14,7 +14,27 @@
1414
@rem limitations under the License.
1515
@rem ***************************************************************************
1616
@echo off
17+
18+
@REM Check if JAVA_HOME is set and valid
19+
if "%JAVA_HOME%" == "" (
20+
echo Error: JAVA_HOME not found in your environment. >&2
21+
echo Please set the JAVA_HOME variable in your environment to match the location of your Java installation. >&2
22+
exit /B 1
23+
)
24+
25+
if not exist "%JAVA_HOME%\bin\java.exe" (
26+
echo Error: JAVA_HOME is set to an invalid directory. >&2
27+
echo JAVA_HOME = "%JAVA_HOME%" >&2
28+
echo Please set the JAVA_HOME variable in your environment to match the location of your Java installation. >&2
29+
exit /B 1
30+
)
31+
32+
set "JAVA_CMD=%JAVA_HOME%\bin\java.exe"
33+
34+
@REM Consolidate classpath entries, initialize ROOT and VERSION
1735
set "ROOT=%~dp0..\"
18-
set "VERSION=1.2.1"
19-
set "classpath=%ROOT%target\classes:%ROOT%lib\*:%ROOT%WEB-INF\lib\*:%ROOT%WEB-INF\classes":%classpath%
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 %*
36+
set "VERSION=1.2.2"
37+
set "classpath=%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"
38+
39+
@REM Run Java application
40+
%JAVA_CMD% -cp "%classpath%" org.tinystruct.system.Dispatcher %*

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<dependency>
2222
<groupId>org.tinystruct</groupId>
2323
<artifactId>tinystruct</artifactId>
24-
<version>1.2.1</version>
24+
<version>1.2.2</version>
2525
</dependency>
2626
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-simple -->
2727
<dependency>

0 commit comments

Comments
 (0)