Skip to content

Commit 9e87041

Browse files
committed
Update phoebus.bat to fit for both development and deployment environment
1 parent c1fcdc7 commit 9e87041

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

phoebus-product/phoebus.bat

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,22 @@
22
@REM Uses a JDK that's located next to this folder,
33
@REM otherwise assumes JDK is on the PATH
44

5-
@cd %~P0
5+
set TOP=%~P0
66
setlocal ENABLEDELAYEDEXPANSION
77

8-
@IF EXIST "%~P0%..\jdk" (
9-
set JAVA_HOME=%~P0%..\jdk
8+
@IF EXIST "%TOP%target" (
9+
set TOP=%TOP%target\
10+
)
11+
12+
@IF EXIST "%TOP%..\jdk" (
13+
set JAVA_HOME=%TOP%..\jdk
1014
@path !JAVA_HOME!\bin
1115
@ECHO Found JDK !JAVA_HOME!
1216
)
1317

14-
@if EXIST "update" (
18+
@IF EXIST "%TOP%update" (
1519
@ECHO Installing update...
20+
@cd "%TOP%"
1621
@rd /S/Q doc
1722
@rd /S/Q lib
1823
@del product*.jar
@@ -25,10 +30,10 @@ setlocal ENABLEDELAYEDEXPANSION
2530

2631
@java -version
2732
echo off
28-
FOR /F "tokens=* USEBACKQ" %%F IN (`dir /B product*.jar`) DO (SET JAR=%%F)
33+
FOR /F "tokens=* USEBACKQ" %%F IN (`dir /B /S "%TOP%product*.jar"`) DO (SET JAR=%%F)
2934
echo on
3035

3136
@REM CA_DISABLE_REPEATER=true: Don't start CA repeater (#494)
3237
@REM To get one instance, use server mode by adding `-server 4918`
33-
@java -DCA_DISABLE_REPEATER=true -Dfile.encoding=UTF-8 -jar %JAR% %*
38+
@java -DCA_DISABLE_REPEATER=true -Dfile.encoding=UTF-8 -jar "%JAR%" %*
3439

0 commit comments

Comments
 (0)