summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaana Dogan <[email protected]>2025-04-21 11:15:55 -0700
committerGitHub <[email protected]>2025-04-21 11:15:55 -0700
commit0a531f732b15834bec38fc77e9aad862ca7add24 (patch)
treed8807418b84a0851193457255ea5bcccb55a1a9b
parent7f95c594c094aea4a623528fd5c5eba16b654b79 (diff)
Ignore grep error if .env doesn't exist (#82)
.env file is optional. If it doesn't exist, the current script outputs "grep: .env: No such file or directory".
-rwxr-xr-xscripts/build.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/build.sh b/scripts/build.sh
index 9a258d87..562f55e1 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -25,6 +25,8 @@ 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)$ ]] || grep -qiE '^GEMINI_CODE_SANDBOX *= *(1|true)' .env; then
+if [[ "${GEMINI_CODE_SANDBOX:-}" =~ ^(1|true)$ ]]; then
+ scripts/build_sandbox.sh -s
+elif [ -f .env ] && grep -qiE '^GEMINI_CODE_SANDBOX *= *(1|true)' .env; then
scripts/build_sandbox.sh -s
fi