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:
@@ -1134,7 +1134,7 @@ run_snowflake_container() {
|
||||
docker pull "$SNOWFLAKE_IMAGE" 2>/dev/null || true
|
||||
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}')
|
||||
|
||||
local _sf_err
|
||||
|
||||
Reference in New Issue
Block a user