diff --git a/bin/logstash-plugin.bat b/bin/logstash-plugin.bat index 424826486..d61e862ed 100644 --- a/bin/logstash-plugin.bat +++ b/bin/logstash-plugin.bat @@ -1,15 +1,14 @@ @echo off +setlocal enabledelayedexpansion -SETLOCAL - -set SCRIPT_DIR=%~dp0 -CALL "%SCRIPT_DIR%\setup.bat" - -:EXEC -if "%VENDORED_JRUBY%" == "" ( - %RUBYCMD% "%LS_HOME%\lib\pluginmanager\main.rb" %* -) else ( - %JRUBY_BIN% %jruby_opts% "%LS_HOME%\lib\pluginmanager\main.rb" %* +call "%~dp0setup.bat" || exit /b 1 +if errorlevel 1 ( + if not defined nopauseonerror ( + pause + ) + exit /B %ERRORLEVEL% ) -ENDLOCAL +%JRUBY_BIN% "%LS_HOME%\lib\pluginmanager\main.rb" %* + +endlocal