From 81258d2bcf638338ab6630b992782c2d50e1b0a2 Mon Sep 17 00:00:00 2001 From: Ben Date: Thu, 3 Nov 2022 11:17:25 +0100 Subject: [PATCH] Ignore remote resources --- src/main.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/main.rs b/src/main.rs index f5f2af9..b984c3d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -73,6 +73,23 @@ fn deserialize(path: &PathBuf) -> Vec { } +fn unsupported(resource: &str) -> bool { + let remote = [ + "git://", + "http://", + "https://", + "github.com", + ]; + + for r in remote { + if resource.starts_with(r) { + return true; + } + } + + return false; +} + fn run(path: PathBuf, result: &mut Vec) { let current_path = normalize(path.clone()); @@ -85,6 +102,10 @@ fn run(path: PathBuf, result: &mut Vec) { .collect(); for r in resources { + if unsupported(&r) { + continue; + }; + let next_path = current_path .parent() .unwrap()