From dbcf7d86afe48ff8161e2c992d1a80afe7e50ea0 Mon Sep 17 00:00:00 2001 From: Jan Date: Mon, 21 Apr 2025 17:23:30 +0100 Subject: [PATCH] fix: redownload premake when version is outdated --- generate.bat | 9 ++++++--- generate.sh | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/generate.bat b/generate.bat index cdf2eb8e..353d9531 100644 --- a/generate.bat +++ b/generate.bat @@ -28,7 +28,7 @@ IF ERRORLEVEL 1 ( ) echo Extracting... -%POWERSHELL_BIN% -NoProfile -NonInteractive -Command "Expand-Archive -LiteralPath build/premake.zip -DestinationPath build" +%POWERSHELL_BIN% -NoProfile -NonInteractive -Command "Expand-Archive -LiteralPath build/premake.zip -DestinationPath build -Force" IF ERRORLEVEL 1 ( echo Extraction failed >&2 exit 2 @@ -59,8 +59,11 @@ IF "%PREMAKE_NO_GLOBAL%" EQU "" ( ) IF EXIST build/premake5.exe ( - set PREMAKE_BIN="build/premake5.exe" - goto runpremake + build\premake5.exe --version >NUL + IF NOT ERRORLEVEL 1 ( + set PREMAKE_BIN="build/premake5.exe" + goto runpremake + ) ) if "%PREMAKE_NO_PROMPT%" NEQ "" ( diff --git a/generate.sh b/generate.sh index b6abf609..f9b423db 100755 --- a/generate.sh +++ b/generate.sh @@ -62,7 +62,7 @@ expect_inside_git_repository PREMAKE_BIN='' if [[ -z "$PREMAKE_NO_GLOBAL" ]] && [[ -x "$(command -v premake5)" ]]; then PREMAKE_BIN='premake5' -elif [[ -x "$(command -v build/premake5)" ]]; then +elif [[ -x "$(command -v build/premake5)" ]] && [[ ! -z "$(build/premake5 --version)" ]]; then PREMAKE_BIN='build/premake5' else echo "Could not find premake5. You can either install it yourself or this script download it for you."