diff options
author | Tim Ermilov <yamalight@gmail.com> | 2020-01-31 22:07:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-31 16:07:37 -0500 |
commit | 2cd3994902fb6a4d4d0603c839a78503d792b96a (patch) | |
tree | e2b16efc22a09ae7020804d794484df4b967e291 /cli/lib.rs | |
parent | 1dc8afe3afc483703641c907075e2d8aa7396cfd (diff) |
Add support for multiple files in fetch command (#3845)
Diffstat (limited to 'cli/lib.rs')
-rw-r--r-- | cli/lib.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cli/lib.rs b/cli/lib.rs index 227dcdb40..42f5bbad1 100644 --- a/cli/lib.rs +++ b/cli/lib.rs @@ -303,6 +303,8 @@ async fn install_command( } async fn fetch_command(flags: DenoFlags) { + let args = flags.argv.clone(); + let (mut worker, state) = create_worker_and_state(flags); let main_module = state.main_module.as_ref().unwrap().clone(); @@ -313,6 +315,18 @@ async fn fetch_command(flags: DenoFlags) { let result = worker.execute_mod_async(&main_module, None, true).await; js_check(result); + + // resolve modules for rest of args if present + let files_len = args.len(); + if files_len > 2 { + for next_specifier in args.iter().take(files_len).skip(2) { + let next_module = + ModuleSpecifier::resolve_url_or_path(&next_specifier).unwrap(); + let result = worker.execute_mod_async(&next_module, None, true).await; + js_check(result); + } + } + if state.flags.lock_write { if let Some(ref lockfile) = state.lockfile { let g = lockfile.lock().unwrap(); |