Created
October 10, 2017 19:18
-
-
Save amitbhoraniya/6da4e88cc846d3bac1c5cae39b1e9883 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal ENABLEDELAYEDEXPANSION | |
set JAVA_OPTS= | |
rem eol stops comments from being parsed | |
rem otherwise split lines at the = char into two tokens | |
for /F "eol=# delims== tokens=1,*" %%a in (test.properties) do ( | |
rem proper lines have both a and b set | |
rem if okay, assign property to some kind of namespace | |
rem so some.property becomes test.some.property in batch-land | |
if NOT "%%a"=="" if NOT "%%b"=="" set "JAVA_OPTS=!JAVA_OPTS!-D%%a=%%b " | |
) | |
rem trim last spaces | |
CALL :TRIM %JAVA_OPT% | |
rem set java options | |
set JAVA_OPT=%TRIMRESULT% | |
rem start tomcat | |
bin\startup.bat | |
:TRIM | |
SET TRIMRESULT=%* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment