fix: Locale-safe CPU value for snowflake docker --cpus flag (#38)

awk printf "%.2f" outputs "1,00" instead of "1.00" on systems with
comma-decimal locales (Turkish, German, etc.), causing docker to
reject the --cpus value. Force LC_ALL=C for the awk call.
This commit is contained in:
SamNet-dev
2026-02-09 19:10:06 -06:00
parent a96c03dfe3
commit 5b6a5963ad

View File

@@ -1134,7 +1134,7 @@ run_snowflake_container() {
docker pull "$SNOWFLAKE_IMAGE" 2>/dev/null || true docker pull "$SNOWFLAKE_IMAGE" 2>/dev/null || true
fi fi
local actual_cpus=$(awk -v req="$sf_cpus" -v cores="$(nproc 2>/dev/null || echo 1)" \ local actual_cpus=$(LC_ALL=C awk -v req="$sf_cpus" -v cores="$(nproc 2>/dev/null || echo 1)" \
'BEGIN{c=req+0; if(c>cores+0) c=cores+0; printf "%.2f",c}') 'BEGIN{c=req+0; if(c>cores+0) c=cores+0; printf "%.2f",c}')
local _sf_err local _sf_err