Skip to content

Commit

Permalink
Fix MySQL data update issue through upgrade the tinystruct version to…
Browse files Browse the repository at this point in the history
… be 1.2.2.
  • Loading branch information
m0ver committed Feb 25, 2024
1 parent 82815b9 commit c736fcd
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
5 changes: 3 additions & 2 deletions bin/dispatcher
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env sh
ROOT="$(pwd)"
VERSION="1.2.1"
VERSION="1.2.2"
cd "$(dirname "$0")" || exit
cd "../"
# Navigate to the root directory
Expand All @@ -15,7 +15,8 @@ args=""
# Loop through each argument
for arg; do
# Extract the first two characters of the argument
str=${arg:0:2}
# str=${arg:0:2}
str=$(echo "$arg" | awk '{ string=substr($0, 0, 2); print string; }' )

# Check if it starts with '-D' or '-X'
if [ "$str" = "-D" ] || [ "$str" = "-X" ]; then
Expand Down
28 changes: 24 additions & 4 deletions bin/dispatcher.cmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@rem ***************************************************************************
@rem Copyright (c) 2017 James Mover Zhou
@rem Copyright (c) 2023 James Mover Zhou
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
Expand All @@ -14,7 +14,27 @@
@rem limitations under the License.
@rem ***************************************************************************
@echo off

@REM Check if JAVA_HOME is set and valid
if "%JAVA_HOME%" == "" (
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the location of your Java installation. >&2
exit /B 1
)

if not exist "%JAVA_HOME%\bin\java.exe" (
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the location of your Java installation. >&2
exit /B 1
)

set "JAVA_CMD=%JAVA_HOME%\bin\java.exe"

@REM Consolidate classpath entries, initialize ROOT and VERSION
set "ROOT=%~dp0..\"
set "VERSION=1.2.1"
set "classpath=%ROOT%target\classes:%ROOT%lib\*:%ROOT%WEB-INF\lib\*:%ROOT%WEB-INF\classes":%classpath%
@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 %*
set "VERSION=1.2.2"
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"

@REM Run Java application
%JAVA_CMD% -cp "%classpath%" org.tinystruct.system.Dispatcher %*
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<dependency>
<groupId>org.tinystruct</groupId>
<artifactId>tinystruct</artifactId>
<version>1.2.1</version>
<version>1.2.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-simple -->
<dependency>
Expand Down

0 comments on commit c736fcd

Please sign in to comment.