diff options
| author | Olcan <[email protected]> | 2025-04-25 10:58:23 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-04-25 10:58:23 -0700 |
| commit | 320f54e2057da5ae92ee47d9d53d1c77a4badc19 (patch) | |
| tree | 9d2239d747828dd191ef4ef682c08853319d9cf5 /scripts/start_sandbox.sh | |
| parent | eea524f6bb8becf851e44a57b397217b0a147be0 (diff) | |
instant (dev) sandbox (#171)
* instant (dev) sandbox
* leave Dockerfile as is to pass deploy test
* fix comma
* fix prod build
* do not use "images exists" which docker does not support
* separate dev-mode flag
* Merge remote-tracking branch 'origin/main' into instant_sandbox
Diffstat (limited to 'scripts/start_sandbox.sh')
| -rwxr-xr-x | scripts/start_sandbox.sh | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/scripts/start_sandbox.sh b/scripts/start_sandbox.sh index 1c3e2417..1661fa14 100755 --- a/scripts/start_sandbox.sh +++ b/scripts/start_sandbox.sh @@ -22,10 +22,23 @@ fi CMD=$(scripts/sandbox_command.sh) IMAGE=gemini-code-sandbox -WORKDIR=/sandbox/$(basename "$PWD") -CLI_PATH=/usr/local/share/npm-global/lib/node_modules/\@gemini-code/cli DEBUG_PORT=9229 +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" == "gemini-code" ]]; then + 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) + echo "ERROR: debugging is sandbox is not supported when target/root is not gemini-code" + exit 1 +fi + # use interactive tty mode and auto-remove container on exit run_args=(-it --rm) |
