summaryrefslogtreecommitdiff
path: root/cli/mainrt.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-03-31 10:58:19 -0400
committerGitHub <noreply@github.com>2024-03-31 10:58:19 -0400
commiteb6f6ff33d5b1e5c4ac799936cd1a80aa6213bdf (patch)
treea6306b68228a81aec43024b183678675d9ca265b /cli/mainrt.rs
parent05598af36edddd94b2349217da0e7c9ec65c06b1 (diff)
refactor: cleanup main entrypoint (#23145)
Diffstat (limited to 'cli/mainrt.rs')
-rw-r--r--cli/mainrt.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/cli/mainrt.rs b/cli/mainrt.rs
index 56bde7c4b..59efa026c 100644
--- a/cli/mainrt.rs
+++ b/cli/mainrt.rs
@@ -30,6 +30,7 @@ use deno_runtime::tokio_util::create_and_run_current_thread_with_maybe_metrics;
pub use deno_runtime::UNSTABLE_GRANULAR_FLAGS;
use deno_terminal::colors;
+use std::borrow::Cow;
use std::env;
use std::env::current_exe;
@@ -70,12 +71,14 @@ fn unwrap_or_exit<T>(result: Result<T, AnyError>) -> T {
fn main() {
let args: Vec<_> = env::args_os().collect();
let current_exe_path = current_exe().unwrap();
- let standalone = standalone::extract_standalone(&current_exe_path, args);
+ let standalone =
+ standalone::extract_standalone(&current_exe_path, Cow::Owned(args));
let future = async move {
match standalone {
Ok(Some(future)) => {
let (metadata, eszip) = future.await?;
- standalone::run(eszip, metadata).await
+ let exit_code = standalone::run(eszip, metadata).await?;
+ std::process::exit(exit_code);
}
Ok(None) => Ok(()),
Err(err) => Err(err),