summaryrefslogtreecommitdiff
path: root/cli/main.rs
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2019-04-19 11:18:46 -0400
committerGitHub <noreply@github.com>2019-04-19 11:18:46 -0400
commit5e5c8553e70cfd092cb5ce8a1c77a29fbba770bf (patch)
tree47fc4a9309b15ef6610edd97f6b967a9a5c6283a /cli/main.rs
parente026320c73fa419b852f00e79e0c602c622d92c3 (diff)
core: test Modules::deps and handle error cases better (#2141)
Diffstat (limited to 'cli/main.rs')
-rw-r--r--cli/main.rs16
1 files changed, 11 insertions, 5 deletions
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()),
+ );
}
}