corrected bat files for building dist

This commit is contained in:
2026-06-17 11:12:56 +02:00
parent 16f30e8d38
commit dae74da39e
2 changed files with 9 additions and 7 deletions
+8 -5
View File
@@ -5,6 +5,7 @@ if "%~1"=="" goto help
set "INPUT=%~1" set "INPUT=%~1"
set "EXT=%~x1" set "EXT=%~x1"
set "PATH=%PATH%;%~dp0"
if /I not "%EXT%"==".pptx" ( if /I not "%EXT%"==".pptx" (
echo [ERROR] Only .pptx supported echo [ERROR] Only .pptx supported
@@ -12,18 +13,20 @@ if /I not "%EXT%"==".pptx" (
exit /b 1 exit /b 1
) )
set "OUT=%~dp1%~n1_compressed.pptx"
echo [INFO] Compressing %~n1 echo [INFO] Compressing %~n1
"%~dp0pptx-image-compress.exe" -i "%INPUT%" -o "%OUT%" rem optional: ensure correct working dir
pushd "%~dp0"
"%~dp0pptx-image-compress.exe" -i "%INPUT%"
set RC=%ERRORLEVEL% set RC=%ERRORLEVEL%
popd
if %RC% neq 0 ( if %RC% neq 0 (
echo [ERROR] Failed (%RC%) echo [ERROR] Failed (%RC%)
) else ( ) else (
echo [SUCCESS] Done echo [SUCCESS] Done
echo Output: "%OUT%"
) )
pause pause
@@ -33,4 +36,4 @@ exit /b %RC%
echo. echo.
echo Drag ^& Drop a .pptx file onto this script echo Drag ^& Drop a .pptx file onto this script
echo. echo.
pause pause
+1 -2
View File
@@ -5,5 +5,4 @@ if "%~1"=="" (
"%~dp0pptx-image-compress.exe" -h "%~dp0pptx-image-compress.exe" -h
) else ( ) else (
"%~dp0pptx-image-compress.exe" %* "%~dp0pptx-image-compress.exe" %*
) )
``