From f3a92285af3ae0d5f4219a35eec5382959e46ec2 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Wed, 28 Sep 2016 00:02:18 -0700 Subject: [PATCH] Keep searching if justfile isn't found --- src/main.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 97a8c2f..73ec06f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -77,7 +77,11 @@ fn main() { loop { match std::fs::metadata("justfile") { Ok(metadata) => if metadata.is_file() { break; }, - Err(error) => die!("Error fetching justfile metadata: {}", error), + Err(error) => { + if error.kind() != std::io::ErrorKind::NotFound { + die!("Error fetching justfile metadata: {}", error) + } + } } match std::fs::metadata("Justfile") { @@ -85,7 +89,11 @@ fn main() { justfile = "Justfile"; break; }, - Err(error) => die!("Error fetching justfile metadata: {}", error), + Err(error) => { + if error.kind() != std::io::ErrorKind::NotFound { + die!("Error fetching Justfile metadata: {}", error) + }; + } } match std::env::current_dir() {