mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-19 07:42:54 +00:00
chore: add possibility to ignore premake5 from path
This commit is contained in:
parent
32c0ecb04d
commit
419481b4da
4
.github/workflows/ci.yaml
vendored
4
.github/workflows/ci.yaml
vendored
@ -30,7 +30,7 @@ jobs:
|
|||||||
- name: Premake generate
|
- name: Premake generate
|
||||||
working-directory: ${{ github.workspace }}
|
working-directory: ${{ github.workspace }}
|
||||||
env:
|
env:
|
||||||
OAT_CI_NO_PROMPT: 1
|
PREMAKE_NO_PROMPT: 1
|
||||||
run: ./generate.sh
|
run: ./generate.sh
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
@ -61,7 +61,7 @@ jobs:
|
|||||||
- name: Premake generate
|
- name: Premake generate
|
||||||
working-directory: ${{ github.workspace }}
|
working-directory: ${{ github.workspace }}
|
||||||
env:
|
env:
|
||||||
OAT_CI_NO_PROMPT: 1
|
PREMAKE_NO_PROMPT: 1
|
||||||
run: ./generate.bat
|
run: ./generate.bat
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
|
4
.github/workflows/release.yaml
vendored
4
.github/workflows/release.yaml
vendored
@ -27,7 +27,7 @@ jobs:
|
|||||||
- name: Premake generate
|
- name: Premake generate
|
||||||
working-directory: ${{ github.workspace }}
|
working-directory: ${{ github.workspace }}
|
||||||
env:
|
env:
|
||||||
OAT_CI_NO_PROMPT: 1
|
PREMAKE_NO_PROMPT: 1
|
||||||
run: ./generate.sh
|
run: ./generate.sh
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
@ -55,7 +55,7 @@ jobs:
|
|||||||
- name: Premake generate
|
- name: Premake generate
|
||||||
working-directory: ${{ github.workspace }}
|
working-directory: ${{ github.workspace }}
|
||||||
env:
|
env:
|
||||||
OAT_CI_NO_PROMPT: 1
|
PREMAKE_NO_PROMPT: 1
|
||||||
run: ./generate.bat
|
run: ./generate.bat
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
|
13
generate.bat
13
generate.bat
@ -3,6 +3,10 @@
|
|||||||
set PREMAKE_URL="https://github.com/premake/premake-core/releases/download/v5.0.0-beta4/premake-5.0.0-beta4-windows.zip"
|
set PREMAKE_URL="https://github.com/premake/premake-core/releases/download/v5.0.0-beta4/premake-5.0.0-beta4-windows.zip"
|
||||||
set PREMAKE_HASH="12d741d3b70445b025c03e26148e2d129801041fa5ddde61b4ac888a76017395"
|
set PREMAKE_HASH="12d741d3b70445b025c03e26148e2d129801041fa5ddde61b4ac888a76017395"
|
||||||
|
|
||||||
|
REM The following variables can be set:
|
||||||
|
REM PREMAKE_NO_GLOBAL - Ignore premake5 executable from path
|
||||||
|
REM PREMAKE_NO_PROMPT - Download premake5 without prompting
|
||||||
|
|
||||||
goto start
|
goto start
|
||||||
|
|
||||||
:downloadpremake
|
:downloadpremake
|
||||||
@ -45,10 +49,13 @@ exit /B 0
|
|||||||
cd %~dp0
|
cd %~dp0
|
||||||
|
|
||||||
:start
|
:start
|
||||||
where /q "premake5.exe"
|
|
||||||
IF %ERRORLEVEL% EQU 0 (
|
IF /i "%PREMAKE_NO_GLOBAL%" EQU "" (
|
||||||
|
where /q "premake5.exe"
|
||||||
|
IF %ERRORLEVEL% EQU 0 (
|
||||||
set PREMAKE_BIN="premake5.exe"
|
set PREMAKE_BIN="premake5.exe"
|
||||||
goto runpremake
|
goto runpremake
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
IF EXIST build/premake5.exe (
|
IF EXIST build/premake5.exe (
|
||||||
@ -56,7 +63,7 @@ IF EXIST build/premake5.exe (
|
|||||||
goto runpremake
|
goto runpremake
|
||||||
)
|
)
|
||||||
|
|
||||||
if "%OAT_CI_NO_PROMPT%" NEQ "" (
|
if "%PREMAKE_NO_PROMPT%" NEQ "" (
|
||||||
call:downloadpremake
|
call:downloadpremake
|
||||||
set PREMAKE_BIN="build/premake5.exe"
|
set PREMAKE_BIN="build/premake5.exe"
|
||||||
goto runpremake
|
goto runpremake
|
||||||
|
@ -3,6 +3,10 @@
|
|||||||
PREMAKE_URL='https://github.com/premake/premake-core/releases/download/v5.0.0-beta4/premake-5.0.0-beta4-linux.tar.gz'
|
PREMAKE_URL='https://github.com/premake/premake-core/releases/download/v5.0.0-beta4/premake-5.0.0-beta4-linux.tar.gz'
|
||||||
PREMAKE_HASH='4356ab7cdec6085183d68fb240089376eacdc2fb751ffbd8063d797ae43abeb3'
|
PREMAKE_HASH='4356ab7cdec6085183d68fb240089376eacdc2fb751ffbd8063d797ae43abeb3'
|
||||||
|
|
||||||
|
# The following variables can be set:
|
||||||
|
# PREMAKE_NO_GLOBAL - Ignore premake5 executable from path
|
||||||
|
# PREMAKE_NO_PROMPT - Download premake5 without prompting
|
||||||
|
|
||||||
function install_premake {
|
function install_premake {
|
||||||
if [[ ! -x "$(command -v wget)" ]]; then
|
if [[ ! -x "$(command -v wget)" ]]; then
|
||||||
echo "Failed: Installation requires wget" >&2
|
echo "Failed: Installation requires wget" >&2
|
||||||
@ -51,13 +55,13 @@ if [[ ! -d ".git" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
PREMAKE_BIN=''
|
PREMAKE_BIN=''
|
||||||
if [[ -x "$(command -v premake5)" ]]; then
|
if [[ -z "$PREMAKE_NO_GLOBAL" ]] && [[ -x "$(command -v premake5)" ]]; then
|
||||||
PREMAKE_BIN='premake5'
|
PREMAKE_BIN='premake5'
|
||||||
elif [[ -x "$(command -v build/premake5)" ]]; then
|
elif [[ -x "$(command -v build/premake5)" ]]; then
|
||||||
PREMAKE_BIN='build/premake5'
|
PREMAKE_BIN='build/premake5'
|
||||||
else
|
else
|
||||||
echo "Could not find premake5. You can either install it yourself or this script download it for you."
|
echo "Could not find premake5. You can either install it yourself or this script download it for you."
|
||||||
if [[ ! -z "$OAT_CI_NO_PROMPT" ]] || [[ "$(read -e -p 'Do you wish to download it automatically? [y/N]> '; echo $REPLY)" == [Yy]* ]]; then
|
if [[ ! -z "$PREMAKE_NO_PROMPT" ]] || [[ "$(read -e -p 'Do you wish to download it automatically? [y/N]> '; echo $REPLY)" == [Yy]* ]]; then
|
||||||
echo "Installing premake"
|
echo "Installing premake"
|
||||||
install_premake
|
install_premake
|
||||||
PREMAKE_BIN='build/premake5'
|
PREMAKE_BIN='build/premake5'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user