Exit Windows scripts promptly on failure

When invoking the elasticsearch-env.bat or x-pack-env.bat batch scripts
on Windows, if these scripts exits due to an error (e.g., Java can not
be found, or the wrong version of Java is found), then the script
exits. Sadly, on Windows, this does not also terminate the caller,
instead returning control. This means we have to explicitly exit so that
is what we do in this commit.

Relates elastic/x-pack-elasticsearch#2126

Original commit: elastic/x-pack-elasticsearch@18645db62c
This commit is contained in:
Jason Tedor 2017-07-31 20:39:59 +09:00 committed by GitHub
parent 50b8a56d34
commit a80b1e4de1
7 changed files with 14 additions and 14 deletions

View File

@ -6,9 +6,9 @@ rem you may not use this file except in compliance with the Elastic License.
setlocal enabledelayedexpansion setlocal enabledelayedexpansion
call "%~dp0..\elasticsearch-env.bat" call "%~dp0..\elasticsearch-env.bat" || exit /b 1
call "%~dp0x-pack-env.bat" call "%~dp0x-pack-env.bat" || exit /b 1
%JAVA% ^ %JAVA% ^
%ES_JAVA_OPTS% ^ %ES_JAVA_OPTS% ^

View File

@ -6,9 +6,9 @@ rem you may not use this file except in compliance with the Elastic License.
setlocal enabledelayedexpansion setlocal enabledelayedexpansion
call "%~dp0..\elasticsearch-env.bat" call "%~dp0..\elasticsearch-env.bat" || exit /b 1
call "%~dp0x-pack-env.bat" call "%~dp0x-pack-env.bat" || exit /b 1
%JAVA% ^ %JAVA% ^
%ES_JAVA_OPTS% ^ %ES_JAVA_OPTS% ^

View File

@ -6,9 +6,9 @@ rem you may not use this file except in compliance with the Elastic License.
setlocal enabledelayedexpansion setlocal enabledelayedexpansion
call "%~dp0..\elasticsearch-env.bat" call "%~dp0..\elasticsearch-env.bat" || exit /b 1
call "%~dp0x-pack-env.bat" call "%~dp0x-pack-env.bat" || exit /b 1
%JAVA% ^ %JAVA% ^
%ES_JAVA_OPTS% ^ %ES_JAVA_OPTS% ^

View File

@ -6,9 +6,9 @@ rem you may not use this file except in compliance with the Elastic License.
setlocal enabledelayedexpansion setlocal enabledelayedexpansion
call "%~dp0..\elasticsearch-env.bat" call "%~dp0..\elasticsearch-env.bat" || exit /b 1
call "%~dp0x-pack-env.bat" call "%~dp0x-pack-env.bat" || exit /b 1
%JAVA% ^ %JAVA% ^
%ES_JAVA_OPTS% ^ %ES_JAVA_OPTS% ^

View File

@ -6,9 +6,9 @@ rem you may not use this file except in compliance with the Elastic License.
setlocal enabledelayedexpansion setlocal enabledelayedexpansion
call "%~dp0..\elasticsearch-env.bat" call "%~dp0..\elasticsearch-env.bat" || exit /b 1
call "%~dp0x-pack-env.bat" call "%~dp0x-pack-env.bat" || exit /b 1
%JAVA% ^ %JAVA% ^
%ES_JAVA_OPTS% ^ %ES_JAVA_OPTS% ^

View File

@ -6,9 +6,9 @@ rem you may not use this file except in compliance with the Elastic License.
setlocal enabledelayedexpansion setlocal enabledelayedexpansion
call "%~dp0..\elasticsearch-env.bat" call "%~dp0..\elasticsearch-env.bat" || exit /b 1
call "%~dp0x-pack-env.bat" call "%~dp0x-pack-env.bat" || exit /b 1
%JAVA% ^ %JAVA% ^
%ES_JAVA_OPTS% ^ %ES_JAVA_OPTS% ^

View File

@ -6,9 +6,9 @@ rem you may not use this file except in compliance with the Elastic License.
setlocal enabledelayedexpansion setlocal enabledelayedexpansion
call "%~dp0..\elasticsearch-env.bat" call "%~dp0..\elasticsearch-env.bat" || exit /b 1
call "%~dp0x-pack-env.bat" call "%~dp0x-pack-env.bat" || exit /b 1
%JAVA% ^ %JAVA% ^
%ES_JAVA_OPTS% ^ %ES_JAVA_OPTS% ^