fix: update sed escape pattern to handle pipe delimiter in save_env_var function

This commit is contained in:
S
2026-03-01 08:58:49 -05:00
parent 135a0b7c0c
commit 61d58790b1

View File

@@ -96,9 +96,9 @@ save_env_var() {
return 1
fi
# Escape special characters in value for sed
# Escape special characters in value for sed (delimiter is |)
local escaped_value
escaped_value=$(printf '%s' "$value" | sed 's/[&/\]/\\&/g')
escaped_value=$(printf '%s' "$value" | sed 's/[&/\|]/\\&/g')
if grep -q "^${key}=" "$env_file"; then
# Replace existing line — match KEY= followed by anything (value + optional comment)