Skip to content

Commit 33f179a

Browse files
committed
Fixed build_flat-color-icons.bat script which hang on AppVeyor because of the pause command.
1 parent 7a77e77 commit 33f179a

1 file changed

Lines changed: 15 additions & 9 deletions

File tree

ci/windows/build_flat-color-icons.bat

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,26 @@ set IMAGE_OUTPUT_DIR=%~dp0..\..\build\third_parties\flat-color-icons
2020
mkdir "%IMAGE_OUTPUT_DIR%" 1>NUL 2>NUL
2121
mkdir "%TEMP_DIR%" 1>NUL 2>NUL
2222

23-
echo Deleting previous resource file %IMAGE_OUTPUT_DIR%\resource.rc...
24-
del %IMAGE_OUTPUT_DIR%\resource.rc 1>NUL 2>NUL
25-
echo done.
26-
echo.
27-
2823
:: For each svg icons
29-
echo Converting each svg file as ico.
30-
echo Searching for svg files in directory "%IMAGE_INPUT_DIR%"...
24+
echo Converting flat-color-icons svg files to ico format.
25+
echo Searching directory: "%IMAGE_INPUT_DIR%".
26+
setlocal EnableDelayedExpansion
3127
for /f %%f in ('dir /b "%IMAGE_INPUT_DIR%"') do (
3228
REM echo %%f
3329
call :process_file "%%f"
30+
if !errorlevel! neq 0 echo Failed to process file "%%f". ERRORLEVEL=!errorlevel! && exit /b !errorlevel!
3431
)
32+
endlocal
3533
echo done.
3634
echo.
3735

38-
pause
36+
echo All flat-color-icons icons converted to ico format.
37+
echo Output directory: "%IMAGE_OUTPUT_DIR%".
38+
echo.
39+
goto :eof
40+
3941

4042

41-
goto :eof
4243

4344
:process_file
4445
@echo off
@@ -49,9 +50,13 @@ goto :eof
4950

5051
echo Processing file: %~1
5152
magick -size 16x16 -background none "%IMAGE_INPUT_DIR%\%~1" "%TEMP_DIR%\%~n1-16.png"
53+
if %errorlevel% neq 0 echo Failure to convert svg file to png. ERRORLEVEL=%errorlevel% && exit /b %errorlevel%
5254
magick -size 32x32 -background none "%IMAGE_INPUT_DIR%\%~1" "%TEMP_DIR%\%~n1-32.png"
55+
if %errorlevel% neq 0 echo Failure to convert svg file to png. ERRORLEVEL=%errorlevel% && exit /b %errorlevel%
5356
magick -size 48x48 -background none "%IMAGE_INPUT_DIR%\%~1" "%TEMP_DIR%\%~n1-48.png"
57+
if %errorlevel% neq 0 echo Failure to convert svg file to png. ERRORLEVEL=%errorlevel% && exit /b %errorlevel%
5458
magick -size 64x64 -background none "%IMAGE_INPUT_DIR%\%~1" "%TEMP_DIR%\%~n1-64.png"
59+
if %errorlevel% neq 0 echo Failure to convert svg file to png. ERRORLEVEL=%errorlevel% && exit /b %errorlevel%
5560

5661
set png_files=
5762
set png_files=%png_files% "%TEMP_DIR%\%~n1-16.png"
@@ -60,6 +65,7 @@ set png_files=%png_files% "%TEMP_DIR%\%~n1-48.png"
6065
set png_files=%png_files% "%TEMP_DIR%\%~n1-64.png"
6166

6267
magick %png_files% "%IMAGE_OUTPUT_DIR%\%~n1.ico"
68+
if %errorlevel% neq 0 echo Failure to convert png files to ico. ERRORLEVEL=%errorlevel% && exit /b %errorlevel%
6369

6470
goto :eof
6571

0 commit comments

Comments
 (0)