Skip to content

Commit

Permalink
feat(cli): run containerised jstzd with 'sandbox start'
Browse files Browse the repository at this point in the history
  • Loading branch information
huancheng-trili committed Jan 16, 2025
1 parent 2c6aa02 commit fa71c86
Show file tree
Hide file tree
Showing 5 changed files with 499 additions and 21 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/jstz_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ansi_term.workspace = true
anyhow.workspace = true
boa_engine.workspace = true
boa_gc.workspace = true
bollard.workspace = true
bs58.workspace = true
clap.workspace = true
clap_complete.workspace = true
Expand Down
13 changes: 10 additions & 3 deletions crates/jstz_cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,13 @@ enum Command {
Bridge(bridge::Command),

/// 🏝️ Start/Stop/Restart the local jstz sandbox
#[command(subcommand)]
Sandbox(sandbox::Command),
Sandbox {
/// Start/Stop/Restart the sandbox in a container
#[clap(long)]
container: bool,
#[command(subcommand)]
command: sandbox::Command,
},
/// ⚡️ Start a REPL session with jstz's JavaScript runtime {n}
Repl {
/// Sets the address of the REPL environment.
Expand Down Expand Up @@ -114,7 +119,9 @@ async fn exec(command: Command) -> Result<()> {
match command {
Command::Docs => docs::exec(),
Command::Completions { shell } => completions::exec(shell),
Command::Sandbox(sandbox_command) => sandbox::exec(sandbox_command).await,
Command::Sandbox { container, command } => {
sandbox::exec(container, command).await
}
Command::Bridge(bridge_command) => bridge::exec(bridge_command).await,
Command::Account(account_command) => account::exec(account_command).await,
Command::Deploy {
Expand Down
Loading

0 comments on commit fa71c86

Please sign in to comment.