Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

コマンドのエラー判定に if errorlevel を使うようにする #590

Merged
merged 2 commits into from
Nov 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions build-chm.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@ if "%CMD_HHC%" == "" (

@rem hhc.exe returns 1 on success, and returns 0 on failure
"%CMD_HHC%" help\macro\macro.HHP
if %errorlevel% equ 0 (echo error && exit /b 1)
if not errorlevel 1 (
echo error macro.HHP errorlevel %errorlevel%
exit /b 1
)

"%CMD_HHC%" help\plugin\plugin.hhp
if %errorlevel% equ 0 (echo error && exit /b 1)

if not errorlevel 1 (
echo error plugin.hhp errorlevel %errorlevel%
exit /b 1
)
"%CMD_HHC%" help\sakura\sakura.hhp
if %errorlevel% equ 0 (echo error && exit /b 1)

if not errorlevel 1 (
echo error sakura.hhp errorlevel %errorlevel%
exit /b 1
)
exit /b 0
11 changes: 8 additions & 3 deletions build-gnu.bat
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,16 @@ path=C:\msys64\mingw64\bin;%path%

@echo mingw32-make -C sakura_core MYDEFINES="%MYDEFINES%" MYCFLAGS="%MYCFLAGS%" MYLIBS="%MYLIBS%"
mingw32-make -C sakura_core MYDEFINES="%MYDEFINES%" MYCFLAGS="%MYCFLAGS%" MYLIBS="%MYLIBS%" githash stdafx Funccode_enum.h Funccode_define.h
if %errorlevel% neq 0 (popd && exit /b 1)
if errorlevel 1 (
echo error 1 errorlevel %errorlevel%
exit /b 1
)

mingw32-make -C sakura_core MYDEFINES="%MYDEFINES%" MYCFLAGS="%MYCFLAGS%" MYLIBS="%MYLIBS%" -j4
if %errorlevel% neq 0 (popd && exit /b 1)

if errorlevel 1 (
echo error 2 errorlevel %errorlevel%
exit /b 1
)
exit /b 0


Expand Down
11 changes: 8 additions & 3 deletions build-sln.bat
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,17 @@ set LOG_OPTION=/flp:logfile=%LOG_FILE%

@echo "%CMD_MSBUILD%" %SLN_FILE% /p:Platform=%platform% /p:Configuration=%configuration% /t:"Build" %EXTRA_CMD% %LOG_OPTION%
"%CMD_MSBUILD%" %SLN_FILE% /p:Platform=%platform% /p:Configuration=%configuration% /t:"Build" %EXTRA_CMD% %LOG_OPTION%
if %errorlevel% neq 0 (echo error && exit /b 1)
if errorlevel 1 (
echo ERROR in msbuild.exe errorlevel %errorlevel%
exit /b 1
)

@echo call parse-buildlog.bat %LOG_FILE%
call parse-buildlog.bat %LOG_FILE%
if %errorlevel% neq 0 (echo error && exit /b 1)

if errorlevel 1 (
echo ERROR in parse-buildlog.bat errorlevel %errorlevel%
exit /b 1
)
exit /b 0

@rem ------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion calc-hash-res.bat
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if not exist "%SRCDIR%" (
)

where python --version 1>nul 2>&1
if not "%ERRORLEVEL%" == "0" (
if errorlevel 1 (
@echo NOTE: No python command
) else (
python calc-hash.py %OUTHASHFILE% %SRCDIR% .res
Expand Down
2 changes: 1 addition & 1 deletion calc-hash.bat
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if not exist "%SRCDIR%" (
)

where python --version 1>nul 2>&1
if not "%ERRORLEVEL%" == "0" (
if errorlevel 1 (
@echo NOTE: No python command
) else (
python calc-hash.py %OUTHASHFILE% %SRCDIR%
Expand Down
4 changes: 2 additions & 2 deletions parse-buildlog.bat
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if "%APPVEYOR%" == "True" (

set ERROR_RESULT=0
where python --version 1>nul 2>&1
if not "%ERRORLEVEL%" == "0" (
if errorlevel 1 (
@echo NOTE: No python command
) else (
python appveyor_env.py
Expand All @@ -37,7 +37,7 @@ exit /b %ERROR_RESULT%
:openpyxl_install

where pip 1>nul 2>&1
if not "%ERRORLEVEL%" == "0" (
if errorlevel 1 (
@echo NOTE: No pip command
) else (
@echo NOTE: found pip command
Expand Down
4 changes: 2 additions & 2 deletions sakura/githash.bat
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pushd "%~dp0"
: Git enabled checking
set GIT_ENABLED=1
where git 1>nul 2>&1
if not "%ERRORLEVEL%" == "0" (
if errorlevel 1 (
set GIT_ENABLED=0
@echo NOTE: No git command
)
Expand Down Expand Up @@ -120,7 +120,7 @@ if "%VALID_CREATE_GITHASH%" == "0" (
call :output_githash > %GITHASH_H_TMP%

fc %GITHASH_H% %GITHASH_H_TMP% 1>nul 2>&1
if "%ERRORLEVEL%" == "0" (
if not errorlevel 1 (
del %GITHASH_H_TMP%
@echo %GITHASH_H% was not updated.
) else (
Expand Down
12 changes: 6 additions & 6 deletions tests/build-and-test.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,24 @@ if "%platform%" == "MinGW" (

@echo ---- start create-project.bat ----
call %~dp0create-project.bat %platform% %configuration%
if %ERRORLEVEL% neq 0 (
@echo ERROR in create-project.bat
if errorlevel 1 (
@echo ERROR in create-project.bat %errorlevel%
exit /b 1
)
@echo ---- end create-project.bat ----

@echo ---- start build-project.bat ----
call %~dp0build-project.bat %platform% %configuration%
if %ERRORLEVEL% neq 0 (
@echo ERROR in build-project.bat
if errorlevel 1 (
@echo ERROR in build-project.bat %errorlevel%
exit /b 1
)
@echo ---- end build-project.bat ----

@echo ---- start run-tests.bat ----
call %~dp0run-tests.bat %platform% %configuration%
if %ERRORLEVEL% neq 0 (
@echo ERROR in run-tests.bat
if errorlevel 1 (
@echo ERROR in run-tests.bat %errorlevel%
exit /b 1
)
@echo ---- end run-tests.bat ----
2 changes: 1 addition & 1 deletion tools/zip/find-7z.bat
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ set RESULT_PATH_7Z_2=--
set RESULT_PATH_7Z_3=--

where 7z 1>nul 2>&1
if "%ERRORLEVEL%" == "0" (
if not errorlevel 1 (
set RESULT_PATH_7Z_0=OK
set CMD_7Z=7z
) else if exist "%PATH_7Z_1%" (
Expand Down