Skip to content

Commit

Permalink
feat(web): Open browser with run wasm (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
tommy-xr authored Jun 15, 2024
1 parent c03fa1c commit c9749d3
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion cli/src/commands/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,22 @@ pub async fn execute(working_directory: &str, environment: &Environment) -> Resu
}];
util::ShellCommand::run_sequential(commands).await
}
Environment::Wasm => WasmDevServer::start(build_wasm_wd.to_str().unwrap()).await,
Environment::Wasm => {
let cmd = if std::env::consts::OS == "windows" {
"start"
} else {
"open"
};
let wasm_server_start = WasmDevServer::start(build_wasm_wd.to_str().unwrap());
let commands = vec![ShellCommand {
prefix: "[Open Browser]",
cmd,
cwd: working_directory,
env: vec![],
args: vec!["http://127.0.0.1:8080"],
}];
util::ShellCommand::run_sequential(commands).await?;
wasm_server_start.await
}
}
}

0 comments on commit c9749d3

Please sign in to comment.