mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 09:31:22 -05:00
Avoid --info crash on missing filename (#1660)
This commit is contained in:
parent
4b61170e22
commit
c144733f72
1 changed files with 5 additions and 9 deletions
14
src/main.rs
14
src/main.rs
|
@ -88,15 +88,6 @@ fn main() {
|
|||
let mut isolate = isolate::Isolate::new(snapshot, state, ops::dispatch);
|
||||
|
||||
tokio_util::init(|| {
|
||||
// Requires tokio
|
||||
if should_display_info {
|
||||
isolate
|
||||
.state
|
||||
.dir
|
||||
.print_file_info(isolate.state.argv[1].clone());
|
||||
std::process::exit(0);
|
||||
}
|
||||
|
||||
// Setup runtime.
|
||||
isolate
|
||||
.execute("denoMain();")
|
||||
|
@ -106,6 +97,11 @@ fn main() {
|
|||
// Execute input file.
|
||||
if isolate.state.argv.len() > 1 {
|
||||
let input_filename = isolate.state.argv[1].clone();
|
||||
if should_display_info {
|
||||
// Display file info and exit. Do not run file
|
||||
isolate.state.dir.print_file_info(input_filename);
|
||||
std::process::exit(0);
|
||||
}
|
||||
isolate
|
||||
.execute_mod(&input_filename, should_prefetch)
|
||||
.unwrap_or_else(print_err_and_exit);
|
||||
|
|
Loading…
Add table
Reference in a new issue