From 8b91408be68676eaf508c0fdc7c0f765c6d3baf2 Mon Sep 17 00:00:00 2001 From: GenZmeY Date: Mon, 14 Feb 2022 04:57:54 +0300 Subject: [PATCH] i want to sleep... --- builder | 68 +++++++++++++++++++++++++++++++++------------------------ 1 file changed, 40 insertions(+), 28 deletions(-) diff --git a/builder b/builder index 6594c29..18b27f3 100644 --- a/builder +++ b/builder @@ -95,12 +95,8 @@ ArgWarnings="false" ArgNoColors="false" # Colors -# shellcheck disable=SC2034 -WHT='' RED='' -# shellcheck disable=SC2034 GRN='' -# shellcheck disable=SC2034 YLW='' BLU='' DEF='' @@ -121,7 +117,7 @@ function get_latest () # $1: Reponame, $2: filename, $3: output filename msg "download $2 ($LatestTag)" mkdir -p "$(dirname "$3")/" curl -LJs "$DownloadUrl" -o "$3" - msg "successfully downloaded" + msg "${GRN}successfully downloaded${DEF}" } function get_latest_multini () # $1: file to save @@ -137,12 +133,8 @@ function get_latest_kfeditor_patcher () # $1: file to save function setup_colors () { if [[ -t 2 ]] && ! is_true "$ArgNoColors" && [[ "${TERM-}" != "dumb" ]]; then - # shellcheck disable=SC2034 - WHT='\e[37m' RED='\e[31m' - # shellcheck disable=SC2034 GRN='\e[32m' - # shellcheck disable=SC2034 YLW='\e[33m' BLU='\e[34m' DEF='\e[0m' @@ -163,7 +155,7 @@ function msg () # $1: String if is_true "$ArgDebug"; then echo -e "${BLU}${1-}${DEF}" >&1 else - echo -e "${DEF}${1-}" >&1 + echo -e "${DEF}${1-}${DEF}" >&1 fi fi } @@ -222,14 +214,14 @@ function cleanup() function backup_kfeditorconf () { - msg "backup $KFEditorConf" + msg "backup $(basename "$KFEditorConf") to $(basename "$KFEditorConfBackup")" cp -f "$KFEditorConf" "$KFEditorConfBackup" } function restore_kfeditorconf () { if [[ -f "$KFEditorConfBackup" ]]; then - msg "restore $KFEditorConf from backup" + msg "restore $(basename "$KFEditorConf") from backup" mv -f "$KFEditorConfBackup" "$KFEditorConf" fi } @@ -238,7 +230,7 @@ function init_build () { local PackageList="" - msg "create new build config ($MutBuildConfig)" + msg "creating new build config" :> "$MutBuildConfig" @@ -251,6 +243,8 @@ function init_build () fi done < <(find "$MutSource" -mindepth 2 -maxdepth 2 -type d -ipath '*/Classes' | sed -r 's|.+/([^/]+)/[^/]+|\1|' | sort) + msg "packages found: $PackageList" + cat > "$MutBuildConfig" </dev/null + else + CMD //C "$(cygpath -w "$KFWorkshop") $(basename "$MutWsInfo")" + fi + msg "${GRN}successfully uploaded to steam workshop${DEF}" rm -rf "$PreparedWsDir" rm -f "$MutWsInfo" @@ -596,7 +597,7 @@ function init_test () local AviableMutators="" local AviableGamemodes="" - msg "create new test config ($MutTestConfig)" + msg "creating new test config" read_build_settings @@ -623,8 +624,14 @@ function init_test () done < <(grep -rihPo '\s.+extends\sKFGameInfo_' "$MutSource/$Package" | awk '{ print $1 }') done + if [[ -n "$AviableMutators" ]]; then + msg "mutators found: $AviableMutators" + fi + if [[ -z "$AviableGamemodes" ]]; then AviableGamemodes="KFGameContent.KFGameInfo_Survival" + else + msg "custom gamemodes found: $AviableGamemodes" fi cat > "$MutTestConfig" <