improve add_project_versioning_to_ffmpeg and remove HEADLESS

This commit is contained in:
2026-01-11 09:56:35 -06:00
parent 47e287ef7f
commit 38c160e2bd
4 changed files with 19 additions and 39 deletions

View File

@@ -279,6 +279,13 @@ is_positive_integer() {
return 0
}
print_line_indent() {
local line="$1"
if [[ ${line} =~ ^( +) ]]; then
echo -n "${BASH_REMATCH[1]}"
fi
}
replace_line() {
local file="$1"
local search="$2"
@@ -286,8 +293,9 @@ replace_line() {
local newFile="${TMP_DIR}/$(bash_basename "${file}")"
test -f "${newFile}" && rm "${newFile}"
while read -r line; do
while IFS= read -r line; do
if line_contains "${line}" "${search}"; then
print_line_indent "${line}" >>"${newFile}"
echo -en "${newLine}" >>"${newFile}"
continue
fi
@@ -349,9 +357,6 @@ spinner() {
start)
test -f "${spinPidFile}" && rm "${spinPidFile}"
# don't want to clutter logs if running headless
test "${HEADLESS}" == '1' && return
_start_spinner &
echo $! >"${spinPidFile}"
;;