diff options
| author | Olcan <[email protected]> | 2025-04-21 11:21:48 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-04-21 11:21:48 -0700 |
| commit | 618f8a43cf9402aba7d441341a46a229c92502dd (patch) | |
| tree | 960e3c1801b10c0fd4952eb4e5610d6d771fa5e1 | |
| parent | 0a531f732b15834bec38fc77e9aad862ca7add24 (diff) | |
don't assume .env file (#83)
| -rwxr-xr-x | scripts/build.sh | 5 | ||||
| -rwxr-xr-x | scripts/start.sh | 3 |
2 files changed, 4 insertions, 4 deletions
diff --git a/scripts/build.sh b/scripts/build.sh index 562f55e1..c959f1b6 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -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 diff --git a/scripts/start.sh b/scripts/start.sh index 51d239af..441eb754 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -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 |
