Skip to content

Commit

Permalink
Ignore remote resources
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-bergia committed Nov 3, 2022
1 parent db6c748 commit 81258d2
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,23 @@ fn deserialize(path: &PathBuf) -> Vec<Kustomization> {
}


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<String>) {
let current_path = normalize(path.clone());

Expand All @@ -85,6 +102,10 @@ fn run(path: PathBuf, result: &mut Vec<String>) {
.collect();

for r in resources {
if unsupported(&r) {
continue;
};

let next_path = current_path
.parent()
.unwrap()
Expand Down

0 comments on commit 81258d2

Please sign in to comment.