summaryrefslogtreecommitdiff
path: root/cli/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/main.rs')
-rw-r--r--cli/main.rs18
1 files changed, 12 insertions, 6 deletions
diff --git a/cli/main.rs b/cli/main.rs
index 091c33b13..16f7d6b9b 100644
--- a/cli/main.rs
+++ b/cli/main.rs
@@ -396,19 +396,21 @@ async fn compile_command(
) -> Result<i32, AnyError> {
let debug = flags.log_level == Some(log::Level::Debug);
- let run_flags =
- tools::standalone::compile_to_runtime_flags(&flags, compile_flags.args)?;
+ let run_flags = tools::standalone::compile_to_runtime_flags(
+ &flags,
+ compile_flags.args.clone(),
+ )?;
let module_specifier = resolve_url_or_path(&compile_flags.source_file)?;
let ps = ProcState::build(Arc::new(flags)).await?;
let deno_dir = &ps.dir;
- let output = compile_flags.output.and_then(|output| {
- if fs_util::path_has_trailing_slash(&output) {
+ let output = compile_flags.output.as_ref().and_then(|output| {
+ if fs_util::path_has_trailing_slash(output) {
let infer_file_name = infer_name_from_url(&module_specifier).map(PathBuf::from)?;
Some(output.join(infer_file_name))
} else {
- Some(output)
+ Some(output.to_path_buf())
}
}).or_else(|| {
infer_name_from_url(&module_specifier).map(PathBuf::from)
@@ -423,6 +425,8 @@ async fn compile_command(
generic_error("There should only be one reference to ModuleGraph")
})?;
+ graph.valid().unwrap();
+
let eszip = eszip::EszipV2::from_graph(graph, Default::default())?;
info!(
@@ -441,7 +445,9 @@ async fn compile_command(
eszip,
module_specifier.clone(),
run_flags,
- )?;
+ ps,
+ )
+ .await?;
info!("{} {}", colors::green("Emit"), output.display());