summaryrefslogtreecommitdiff
path: root/scripts/build.sh
diff options
context:
space:
mode:
authorOlcan <[email protected]>2025-04-21 07:50:18 -0700
committerGitHub <[email protected]>2025-04-21 07:50:18 -0700
commit39bdedab9c218ca1e4eb7204e7c1dd085be98635 (patch)
tree83806d21e6bbf036b92d9b792999d9474d4a9389 /scripts/build.sh
parentbfb064024e3e88c0f707595b50e48a1e7c65063b (diff)
seamless sandboxing (just set GEMINI_CODE_SANDBOX=true in .env) (#76)
Diffstat (limited to 'scripts/build.sh')
-rwxr-xr-xscripts/build.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/build.sh b/scripts/build.sh
new file mode 100755
index 00000000..f4f4ce91
--- /dev/null
+++ b/scripts/build.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+set -euo pipefail
+
+# npm install if node_modules was removed (e.g. via npm run clean or scripts/clean.sh)
+if [ ! -d "node_modules" ]; then
+ npm install
+fi
+
+# build all workspaces/packages
+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
+ scripts/build_sandbox.sh -s
+fi