Fix functional-tests.sh file generation under macOS (#4875)

Fixes #4874 

`head -c 0` leads to an `head: illegal byte count -- 0` error under macOS. We should also provide the input with `-i` parameter (it's ok under GNU/Linux too)
This commit is contained in:
David Legrand
2024-03-16 03:01:31 -07:00
committed by GitHub
parent 2508db9c56
commit 795ed1eb49
+3 -3
View File
@@ -1149,15 +1149,15 @@ function __init__()
MC_CMD=( "${MC}" --config-dir "$MC_CONFIG_DIR" --quiet --no-color )
if [ ! -e "$FILE_0_B" ]; then
base64 /dev/urandom | head -c 0 >"$FILE_0_B"
touch "$FILE_0_B"
fi
if [ ! -e "$FILE_1_MB" ]; then
base64 /dev/urandom | head -c 1048576 >"$FILE_1_MB"
base64 -i /dev/urandom | head -c 1048576 >"$FILE_1_MB"
fi
if [ ! -e "$FILE_65_MB" ]; then
base64 /dev/urandom | head -c 68157440 >"$FILE_65_MB"
base64 -i /dev/urandom | head -c 68157440 >"$FILE_65_MB"
fi
set -E