diff --git a/fly/lib/common.sh b/fly/lib/common.sh index 40b8e794..21d0b91f 100644 --- a/fly/lib/common.sh +++ b/fly/lib/common.sh @@ -685,8 +685,10 @@ except Exception: # List all Fly.io apps and machines list_servers() { - local org=$(get_fly_org) - local response=$(fly_api GET "/apps?org_slug=$org") + local org + org=$(get_fly_org) + local response + response=$(fly_api GET "/apps?org_slug=$org") printf '%s' "$response" | python3 -c " import json, sys diff --git a/shared/common.sh b/shared/common.sh index e0eb92a6..a5d002b6 100644 --- a/shared/common.sh +++ b/shared/common.sh @@ -1278,7 +1278,9 @@ generate_env_config() { fi # Escape any single quotes in the value: replace ' with '\'' - local escaped_value="${value//\'/\'\\\'\'}" + # Use sed instead of ${//} pattern substitution for bash 3.2 (macOS) compat + local escaped_value + escaped_value=$(printf '%s' "$value" | sed "s/'/'\\\\''/g") echo "export ${key}='${escaped_value}'" done }