From f237082c37a10db1bf9d7daddf039bf4e002ec61 Mon Sep 17 00:00:00 2001 From: Olcan Date: Fri, 2 May 2025 12:04:22 -0700 Subject: pass PATH and PYTHONPATH into sandbox, let sandbox scripts recognize user settings for sandbox (#247) --- scripts/sandbox_command.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'scripts/sandbox_command.sh') 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 -- cgit v1.2.3