From 1c066548b4d5fcaea4f784a0cddab7a644716eab Mon Sep 17 00:00:00 2001 From: Olcan Date: Thu, 29 May 2025 16:25:16 -0700 Subject: [PATCH] allow comments in settings when parsed in scripts via jq (#603) --- scripts/sandbox_command.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/sandbox_command.sh b/scripts/sandbox_command.sh index 11a5d62e..61dd3178 100755 --- a/scripts/sandbox_command.sh +++ b/scripts/sandbox_command.sh @@ -35,7 +35,7 @@ shift $((OPTIND - 1)) # note it can be string or boolean, and if missing jq will return null USER_SETTINGS_FILE="$HOME/.gemini/settings.json" if [ -z "${GEMINI_SANDBOX:-}" ] && [ -f "$USER_SETTINGS_FILE" ]; then - USER_SANDBOX_SETTING=$(jq -r '.sandbox' "$USER_SETTINGS_FILE") + USER_SANDBOX_SETTING=$(sed -e 's/\/\/.*//' -e 's/\/\*.*\*\///g' -e '/^[[:space:]]*\/\//d' "$USER_SETTINGS_FILE" | jq -r '.sandbox') if [ "$USER_SANDBOX_SETTING" != null ]; then GEMINI_SANDBOX=$USER_SANDBOX_SETTING fi