From 5e5c8553e70cfd092cb5ce8a1c77a29fbba770bf Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Fri, 19 Apr 2019 11:18:46 -0400 Subject: core: test Modules::deps and handle error cases better (#2141) --- cli/main.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'cli') diff --git a/cli/main.rs b/cli/main.rs index b6cd49d0e..41aeca1c9 100644 --- a/cli/main.rs +++ b/cli/main.rs @@ -108,12 +108,18 @@ pub fn print_file_info(worker: &Worker, url: &str) { ); } - let deps = worker.modules.deps(&out.module_name); - println!("{}{}", ansi::bold("deps:\n".to_string()), deps.name); - if let Some(ref depsdeps) = deps.deps { - for d in depsdeps { - println!("{}", d); + if let Some(deps) = worker.modules.deps(&out.module_name) { + println!("{}{}", ansi::bold("deps:\n".to_string()), deps.name); + if let Some(ref depsdeps) = deps.deps { + for d in depsdeps { + println!("{}", d); + } } + } else { + println!( + "{} cannot retrieve full dependency graph", + ansi::bold("deps:".to_string()), + ); } } -- cgit v1.2.3