summaryrefslogtreecommitdiff
path: root/cli/main.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-04-19 17:50:56 -0400
committerGitHub <noreply@github.com>2023-04-19 21:50:56 +0000
commitc2e9c8cce5ce1a1c4e81f685a552dc4b6955f421 (patch)
tree52d45cfea75d62732ef4f3e0f12a5c1d46ac4f00 /cli/main.rs
parent10442350c31c94f75855a93a5e78f4c6b5b8e382 (diff)
fix(compile): write bytes directly to output file (#18777)
1. Adds cli/standalone folder 2. Writes the bytes directly to the output file. When adding npm packages this might get quite large, so let's not keep the final output in memory just in case.
Diffstat (limited to 'cli/main.rs')
-rw-r--r--cli/main.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/cli/main.rs b/cli/main.rs
index 5e088d891..02ac5891c 100644
--- a/cli/main.rs
+++ b/cli/main.rs
@@ -42,6 +42,7 @@ use deno_runtime::colors;
use deno_runtime::fmt_errors::format_js_error;
use deno_runtime::tokio_util::run_local;
use std::env;
+use std::env::current_exe;
use std::path::PathBuf;
async fn run_subcommand(flags: Flags) -> Result<i32, AnyError> {
@@ -245,8 +246,11 @@ pub fn main() {
let args: Vec<String> = env::args().collect();
let future = async move {
+ let current_exe_path = current_exe()?;
let standalone_res =
- match standalone::extract_standalone(args.clone()).await {
+ match standalone::extract_standalone(&current_exe_path, args.clone())
+ .await
+ {
Ok(Some((metadata, eszip))) => standalone::run(eszip, metadata).await,
Ok(None) => Ok(()),
Err(err) => Err(err),