summaryrefslogtreecommitdiff
path: root/scripts/start_sandbox.sh
diff options
context:
space:
mode:
authorOlcan <[email protected]>2025-04-28 08:52:18 -0700
committerGitHub <[email protected]>2025-04-28 08:52:18 -0700
commit491a9da80b3ef7fe1c5cfe865f0dc0fbee6105f3 (patch)
tree62411aaf383bab1678be54f68cb8039102246213 /scripts/start_sandbox.sh
parenta8f679ccb55402215366cc86acfd5c221613b670 (diff)
rename dev image with -dev suffix (#195)
Diffstat (limited to 'scripts/start_sandbox.sh')
-rwxr-xr-xscripts/start_sandbox.sh21
1 files changed, 10 insertions, 11 deletions
diff --git a/scripts/start_sandbox.sh b/scripts/start_sandbox.sh
index 18e81bde..89046fbe 100755
--- a/scripts/start_sandbox.sh
+++ b/scripts/start_sandbox.sh
@@ -23,28 +23,27 @@ fi
CMD=$(scripts/sandbox_command.sh)
IMAGE=gemini-code-sandbox
DEBUG_PORT=9229
-
-# stop if image is missing
-if ! $CMD images -q "$IMAGE" | grep -q .; then
- echo "ERROR: $IMAGE is missing. Try \`npm run build\` with sandboxing enabled."
- exit 1
-fi
-
PROJECT=$(basename "$PWD")
WORKDIR=/sandbox/$PROJECT
CLI_PATH=/usr/local/share/npm-global/lib/node_modules/\@gemini-code/cli
-# if project is gemini-code, then run CLI from $WORKDIR/packages/cli
-# note this means the global installation is not required in this case
+# if project is gemini-code, then switch to -dev image & run CLI from $WORKDIR/packages/cli
if [[ "$PROJECT" == "gemini-code" ]]; then
+ IMAGE+="-dev"
CLI_PATH="$WORKDIR/packages/cli"
elif [ -n "${DEBUG:-}" ]; then
- # refuse to debug using global installation
- # (requires a separate attach config in launch.json, see comments there around remoteRoot)
+ # refuse to debug using global installation for now (can be added later)
+ # (requires a separate attach config, see comments in launch.json around remoteRoot)
echo "ERROR: debugging is sandbox is not supported when target/root is not gemini-code"
exit 1
fi
+# stop if image is missing
+if ! $CMD images -q "$IMAGE" | grep -q .; then
+ echo "ERROR: $IMAGE is missing. Try \`npm run build\` with sandboxing enabled."
+ exit 1
+fi
+
# use interactive tty mode and auto-remove container on exit
run_args=(-it --rm)