don't assume .env file (#83)

This commit is contained in:
Olcan 2025-04-21 11:21:48 -07:00 committed by GitHub
parent 0a531f732b
commit 618f8a43cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -25,8 +25,7 @@ npm run build --workspaces
# also build container image if GEMINI_CODE_SANDBOX is set (can be in .env file)
# skip (-s) npm install + build since we did that above
if [[ "${GEMINI_CODE_SANDBOX:-}" =~ ^(1|true)$ ]]; then
scripts/build_sandbox.sh -s
elif [ -f .env ] && grep -qiE '^GEMINI_CODE_SANDBOX *= *(1|true)' .env; then
if [[ "${GEMINI_CODE_SANDBOX:-}" =~ ^(1|true)$ ]] || \
{ [ -f .env ] && grep -qiE '^GEMINI_CODE_SANDBOX *= *(1|true)' .env; }; then
scripts/build_sandbox.sh -s
fi

View File

@ -19,7 +19,8 @@ set -euo pipefail
node ./scripts/check-build-status.js
# if GEMINI_CODE_SANDBOX is set (can be in .env file), start in sandbox container
if [[ "${GEMINI_CODE_SANDBOX:-}" =~ ^(1|true)$ ]] || grep -qiE '^GEMINI_CODE_SANDBOX *= *(1|true)' .env; then
if [[ "${GEMINI_CODE_SANDBOX:-}" =~ ^(1|true)$ ]] || \
{ [ -f .env ] && grep -qiE '^GEMINI_CODE_SANDBOX *= *(1|true)' .env; }; then
echo "Running in sandbox container ..."
scripts/start_sandbox.sh "$@"
else