1
0

fix script for spaces in path

This commit is contained in:
GenZmeY 2023-04-01 01:36:25 +03:00
parent db59f4c541
commit f0bf3e20c7

34
builder
View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# Copyright (C) 2022 GenZmeY # Copyright (C) 2022-2023 GenZmeY
# mailto: genzmey@gmail.com # mailto: genzmey@gmail.com
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
@ -569,10 +569,14 @@ function merge_package () # $1: What, $2: Where
msg "merge $1 into $2" msg "merge $1 into $2"
if is_true "$ArgHoldEditor"; then if is_true "$ArgHoldEditor"; then
CMD //C "cd /D $(cygpath -w "$KFWin64") && $(basename "$KFEditorMergePackages") make $1 $2" pushd "$KFWin64" &> /dev/null
CMD //C "$(basename "$KFEditorMergePackages")" make "$1" "$2"
popd &> /dev/null
else else
ModificationTime="$(stat -c %y "$KFWin64/$2")" ModificationTime="$(stat -c %y "$KFWin64/$2")"
CMD //C "cd /D $(cygpath -w "$KFWin64") && $(basename "$KFEditorMergePackages") make $1 $2" & pushd "$KFWin64" &> /dev/null
CMD //C "$(basename "$KFEditorMergePackages")" make "$1" "$2" &
popd &> /dev/null
PID="$!" PID="$!"
while ps -p "$PID" &> /dev/null while ps -p "$PID" &> /dev/null
do do
@ -721,14 +725,14 @@ function compile ()
msg "compilation" msg "compilation"
if is_true "$ArgHoldEditor"; then if is_true "$ArgHoldEditor"; then
CMD //C "$(cygpath -w "$KFEditor")" make $StripSourceArg -useunpublished CMD //C "$(cygpath -w "$KFEditor")" make "$StripSourceArg" -useunpublished
parse_log "$(find_log)" parse_log "$(find_log)"
if ! compiled; then if ! compiled; then
die "compilation failed" die "compilation failed"
fi fi
msg "${GRN}successfully compiled${DEF}" msg "${GRN}successfully compiled${DEF}"
else else
CMD //C "$(cygpath -w "$KFEditor")" make $StripSourceArg -useunpublished & CMD //C "$(cygpath -w "$KFEditor")" make "$StripSourceArg" -useunpublished &
PID="$!" PID="$!"
while ps -p "$PID" &> /dev/null while ps -p "$PID" &> /dev/null
do do
@ -831,14 +835,14 @@ function brew ()
if [[ -n "$PackageBrew" ]]; then if [[ -n "$PackageBrew" ]]; then
if is_true "$ArgHoldEditor"; then if is_true "$ArgHoldEditor"; then
CMD //C "cd /D $(cygpath -w "$KFWin64") && $(basename "$KFEditor") brewcontent -platform=PC $PackageBrew -useunpublished" pushd "$KFWin64" &> /dev/null
if ! brewed "$PackageBrew"; then CMD //C "$(basename "$KFEditor")" brewcontent -platform=PC "$PackageBrew" -useunpublished
brew_cleanup popd &> /dev/null
die "brewing failed"
fi
else else
CMD //C "cd /D $(cygpath -w "$KFWin64") && $(basename "$KFEditor") brewcontent -platform=PC $PackageBrew -useunpublished" & pushd "$KFWin64" &> /dev/null
CMD //C "$(basename "$KFEditor")" brewcontent -platform=PC "$PackageBrew" -useunpublished &
PID="$!" PID="$!"
popd &> /dev/null
while ps -p "$PID" &> /dev/null while ps -p "$PID" &> /dev/null
do do
if brewed "$PackageBrew"; then if brewed "$PackageBrew"; then
@ -847,12 +851,12 @@ function brew ()
fi fi
sleep 1 sleep 1
done done
fi
if ! brewed "$PackageBrew"; then if ! brewed "$PackageBrew"; then
brew_cleanup brew_cleanup
die "brewing failed" die "brewing failed"
fi fi
fi fi
fi
if [[ -n "$PackagePeelzBrew" ]]; then if [[ -n "$PackagePeelzBrew" ]]; then
msg "peelz brewing" msg "peelz brewing"
@ -862,7 +866,9 @@ function brew ()
fi fi
msg "patching $(basename "$KFEditor")" msg "patching $(basename "$KFEditor")"
CMD //C "cd /D $(cygpath -w "$KFWin64") && $(basename "$KFEditorPatcher")" pushd "$KFWin64" &> /dev/null
CMD //C "$(basename "$KFEditorPatcher")"
popd &> /dev/null
msg "${GRN}successfully patched${DEF}" msg "${GRN}successfully patched${DEF}"
for Package in $PackagePeelzBrew for Package in $PackagePeelzBrew
@ -977,7 +983,7 @@ function run_test ()
msg "run test (unpublished)" msg "run test (unpublished)"
fi 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
} }
function parse_combined_params () # $1: Combined short parameters function parse_combined_params () # $1: Combined short parameters