Skip to content

Commit c3bb977

Browse files
committed
reset errorlevel before tool run, set the current on exit
1 parent eae3aab commit c3bb977

7 files changed

+21
-5
lines changed

bin/phpsdk_buildtree.bat

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ IF "%2" EQU "" SET _=%CD%\%1
77
rem if we're in the starter script shell, create the only struct that corresponds to the current env
88
rem otherwise - retain the old behavior, create structs for all the known build combinations and don't cd
99

10+
cmd /c "exit /b 0"
11+
1012
if "%PHP_SDK_ARCH%" NEQ "" (
1113
if "%PHP_SDK_VC%" NEQ "" (
1214
MD %_%\%PHP_SDK_VC%\%PHP_SDK_ARCH%\deps\bin
@@ -35,3 +37,5 @@ echo phpsdk_buildtree ^<nameofthetree^> [PATH]
3537
echo Create the common directory structure used by the PHP SDK
3638

3739
:EXIT
40+
exit /b %errorlevel%
41+

bin/phpsdk_deps.bat

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
@echo off
22

3+
cmd /c "exit /b 0"
4+
35
if "%PHP_SDK_PHP_CMD%"=="" (
46
call %~dp0phpsdk_setvars.bat
57
if "!PHP_SDK_PHP_CMD!"=="" (
@@ -10,5 +12,5 @@ if "%PHP_SDK_PHP_CMD%"=="" (
1012

1113
call %PHP_SDK_PHP_CMD% %PHP_SDK_BIN_PATH%\phpsdk_deps.php %*
1214

13-
exit /b
15+
exit /b %errorlevel%
1416

bin/phpsdk_dllmap.bat

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
@echo off
22

3+
cmd /c "exit /b 0"
4+
35
if "%PHP_SDK_PHP_CMD%"=="" (
46
call %~dp0phpsdk_setvars.bat
57
if "!PHP_SDK_PHP_CMD!"=="" (
@@ -10,5 +12,5 @@ if "%PHP_SDK_PHP_CMD%"=="" (
1012

1113
call %PHP_SDK_PHP_CMD% %PHP_SDK_BIN_PATH%\phpsdk_dllmap.php %*
1214

13-
exit /b
15+
exit /b %errorlevel%
1416

bin/phpsdk_dumpenv.bat

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ if "%PHP_SDK_OS_ARCH%"=="" (
55
exit /b 3
66
)
77

8+
cmd /c "exit /b 0"
9+
810
echo.
911

1012
call %PHP_SDK_BIN_PATH%\phpsdk_version.bat
@@ -26,5 +28,5 @@ echo Visual C++: %PHP_SDK_VC_NUM%
2628
echo PHP-SDK path: %PHP_SDK_ROOT_PATH%
2729

2830

29-
exit /b
31+
exit /b %errorlevel%
3032

bin/phpsdk_setshell.bat

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ if "%1"=="-h" goto :help
1313
if "%1"=="--help" goto :help
1414
if "%2"=="" goto :help
1515

16+
cmd /c "exit /b 0"
17+
1618
set PHP_SDK_VC=%1
1719
if /i not "%PHP_SDK_VC:~0,2%"=="vc" (
1820
:malformed_vc_string

bin/phpsdk_setvars.bat

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
@echo off
22

3+
cmd /c "exit /b 0"
4+
35
rem Add necessary dirs to the path
46

57
set PHP_SDK_BIN_PATH=%~dp0
@@ -15,5 +17,5 @@ set PHP_SDK_PHP_CMD=%PHP_SDK_BIN_PATH%\php\do_php.bat
1517

1618
set PATH=%PHP_SDK_BIN_PATH%;%PHP_SDK_MSYS2_PATH%;%PATH%
1719

18-
exit /b
20+
exit /b %errorlevel%
1921

bin/phpsdk_version.bat

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
@echo off
22

3+
cmd /c "exit /b 0"
4+
35
if "%PHP_SDK_PHP_CMD%"=="" (
46
call %~dp0phpsdk_setvars.bat
57
if "!PHP_SDK_PHP_CMD!"=="" (
@@ -10,5 +12,5 @@ if "%PHP_SDK_PHP_CMD%"=="" (
1012

1113
%PHP_SDK_PHP_CMD% -r "echo 'PHP SDK ' . file_get_contents(getenv('PHP_SDK_ROOT_PATH') . '\\VERSION');"
1214

13-
exit /b
15+
exit /b %errorlevel%
1416

0 commit comments

Comments
 (0)