From dd0bf0a09eee3b81400a91abba2333150f1a55e0 Mon Sep 17 00:00:00 2001 From: GenZmeY Date: Sat, 15 Jan 2022 05:48:16 +0300 Subject: [PATCH] some more fixes --- .gitignore | 1 + README.md | 5 ++++- builder | 18 ++++++++++-------- common.lib | 2 +- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index d8364e1..dc23619 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ 3rd-party-bin +shellcheck.exe diff --git a/README.md b/README.md index dac8b34..5a5eaba 100644 --- a/README.md +++ b/README.md @@ -1 +1,4 @@ -# KF2-Builder \ No newline at end of file +# KF2-BuildTools + +git submodule add https://github.com/GenZmeY/KF2-BuildTools tools +./tools/builder -i \ No newline at end of file diff --git a/builder b/builder index 5b9a38e..ca3d9df 100644 --- a/builder +++ b/builder @@ -164,7 +164,7 @@ function merge_packages () # $1: Mutator name if [[ -n "$UpkList" ]]; then ModificationTime=$(stat -c %y "$KFWin64/$1.u") - CMD //C "cd \"$(cygpath -w "$KFWin64")\" && $(basename \""$KFEditorMergePackages"\") make $UpkList $1.u" & + CMD //C "cd /D $(cygpath -w "$KFWin64") && $(basename "$KFEditorMergePackages") make $UpkList $1.u" & PID="$!" while ps -p "$PID" &> /dev/null do @@ -194,9 +194,9 @@ function compile () local PID="" read_build_settings - + if ! command -v multini &> /dev/null; then - get_latest_multini "$ThirdPartyBin" + get_latest_multini "$ThirdPartyBin/multini.exe" fi backup_kfeditorconf @@ -227,7 +227,7 @@ function compile () cp -rf "$MutConfig"/* "$KFUnpublishConfig" fi - CMD //C "$(cygpath -w "$KFEditor")" make -stripsource -useunpublished & + CMD //C "$(cygpath -w "$KFEditor") make -stripsource -useunpublished" & PID="$!" while ps -p "$PID" &> /dev/null do @@ -276,7 +276,7 @@ function brew () mkdir -p "$KFPublishBrewedPC" - CMD //C "cd \"$(cygpath -w "$KFWin64")\" && \"$(basename "$KFEditor")\" brewcontent -platform=PC $PackageUpload -useunpublished" & + CMD //C "cd /D $(cygpath -w "$KFWin64") && $(basename "$KFEditor") brewcontent -platform=PC $PackageUpload -useunpublished" & PID="$!" while ps -p "$PID" &> /dev/null do @@ -355,9 +355,9 @@ function upload () \$PackageDirectory \"$(cygpath -w "$PreparedWsDir")\" EOF - cp -rf "$KFPublish"/* "$PreparedWsDir" + cp -rf "$KFPublish" "$PreparedWsDir" - CMD //C "$(cygpath -w "$KFWorkshop")" "$(basename "$MutWsInfo")" + CMD //C "$(cygpath -w "$KFWorkshop") $(basename "$MutWsInfo")" rm -rf "$PreparedWsDir" rm -f "$MutWsInfo" @@ -368,6 +368,8 @@ function init_test () local AviableMutators="" local AviableGamemodes="" + read_build_settings + for Package in $PackageUpload do # find available mutators @@ -439,7 +441,7 @@ function run_test () if ! brewed; then UseUnpublished="-useunpublished"; fi - CMD //C "$(cygpath -w "$KFGame")" "$Map?Difficulty=$Difficulty?GameLength=$GameLength?Game=$Game?Mutator=$Mutators?$Args" "$UseUnpublished" -log + CMD //C "$(cygpath -w "$KFGame") $Map?Difficulty=$Difficulty?GameLength=$GameLength?Game=$Game?Mutator=$Mutators?$Args $UseUnpublished" -log } export PATH="$PATH:$ThirdPartyBin" diff --git a/common.lib b/common.lib index d8a672d..dddb198 100644 --- a/common.lib +++ b/common.lib @@ -14,7 +14,7 @@ function get_latest () # $1: Reponame, $2: filename, $3: output filename local LatestTag=$(curl --silent "$ApiUrl" | grep -Po '"tag_name": "\K.*?(?=")') local DownloadUrl="https://github.com/$1/releases/download/$LatestTag/$2" - mkdir -p $(dirname "$3") + mkdir -p "$(dirname "$3")/" curl -LJs "$DownloadUrl" -o "$3" }