Skip to content

Commit 02e116f

Browse files
gitchenjhklboke
authored andcommitted
完善启动脚本
1 parent 5af3a97 commit 02e116f

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1+
@echo off
2+
set "KKFILEVIEW_BIN_FOLDER=%cd%"
3+
cd "%KKFILEVIEW_BIN_FOLDER%"
4+
echo Using KKFILEVIEW_BIN_FOLDER %KKFILEVIEW_BIN_FOLDER%
5+
echo Starting kkFileView...
6+
echo Please check log file for more information
17
java -Dspring.config.location=..\conf\application.properties -jar jodconverter-web-1.5.8.RELEASE.jar -> ..\log\kkFileView.log
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
#!/bin/bash
2+
KKFILEVIEW_BIN_FOLDER=$(cd "$(dirname "$0")";pwd)
3+
export KKFILEVIEW_BIN_FOLDER=$KKFILEVIEW_BIN_FOLDER
4+
cd $KKFILEVIEW_BIN_FOLDER
5+
echo "Using KKFILEVIEW_BIN_FOLDER $KKFILEVIEW_BIN_FOLDER"
6+
echo "Starting kkFileView..."
7+
echo "Please check log file for more information"
28
nohup java -Dspring.config.location=../conf/application.properties -jar jodconverter-web-1.5.8.RELEASE.jar ../log/kkFileView.log 2>&1 &

jodconverter-web/src/main/java/cn/keking/config/ConfigRefreshComponent.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ class ConfigRefreshThread implements Runnable {
3232
public void run() {
3333
try {
3434
Properties properties = new Properties();
35-
String userDir = System.getProperty("user.dir");
36-
Properties properties1 = System.getProperties();
35+
String userDir = System.getenv("KKFILEVIEW_BIN_FOLDER");
36+
if (userDir == null) {
37+
System.getProperty("user.dir");
38+
}
3739
if (userDir.endsWith("bin")) {
3840
userDir = userDir.substring(0, userDir.length() - 4);
3941
}

0 commit comments

Comments
 (0)