summaryrefslogtreecommitdiff
path: root/scripts/sandbox_command.sh
diff options
context:
space:
mode:
authorOlcan <[email protected]>2025-05-02 12:04:22 -0700
committerGitHub <[email protected]>2025-05-02 12:04:22 -0700
commitf237082c37a10db1bf9d7daddf039bf4e002ec61 (patch)
tree6a6cd58a8f77226dae77943bc2c41e74a0a2fbd8 /scripts/sandbox_command.sh
parentb9da7290e1cafca8fb197b8412843c91d0ce9f1f (diff)
pass PATH and PYTHONPATH into sandbox, let sandbox scripts recognize user settings for sandbox (#247)
Diffstat (limited to 'scripts/sandbox_command.sh')
-rwxr-xr-xscripts/sandbox_command.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/sandbox_command.sh b/scripts/sandbox_command.sh
index fab94b52..f527292c 100755
--- a/scripts/sandbox_command.sh
+++ b/scripts/sandbox_command.sh
@@ -31,6 +31,16 @@ while getopts ":q" opt; do
done
shift $((OPTIND - 1))
+# if GEMINI_CODE_SANDBOX is not set, see if it is set in user settings
+# note it can be string or boolean, and if missing jq will return null
+USER_SETTINGS_FILE=~/.gemini/settings.json
+if [ -z "${GEMINI_CODE_SANDBOX:-}" ] && [ -f "$USER_SETTINGS_FILE" ]; then
+ USER_SANDBOX_SETTING=$(jq -r '.sandbox' "$USER_SETTINGS_FILE")
+ if [ "$USER_SANDBOX_SETTING" != null ]; then
+ GEMINI_CODE_SANDBOX=$USER_SANDBOX_SETTING
+ fi
+fi
+
# if GEMINI_CODE_SANDBOX is not set, try to source .env in case set there
# allow .env to be in any ancestor directory (same as findEnvFile in config.ts)
if [ -z "${GEMINI_CODE_SANDBOX:-}" ]; then