Skip to content

Commit

Permalink
Ignore remote and missing files
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-bergia committed Oct 26, 2022
1 parent ae830f9 commit 341c403
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,26 +60,27 @@ fn deserialize(path: PathBuf) -> Vec<Kustomization> {


fn run(path: PathBuf, result: Vec<PathBuf>) {
let canonical = canonical_path(path.clone()).unwrap();
println!("{}", canonical.display());

let resources: Vec<String> = deserialize(canonical.clone())
.iter()
.map(|doc| doc.resources.clone())
.flatten()
.collect();

for r in resources {
let mut next_path = canonical
.parent()
.unwrap()
.to_path_buf();
next_path.push(PathBuf::from(r));

let mut branch = result.clone();

branch.push(canonical.clone());
run(next_path, branch);
if let Ok(canonical) = canonical_path(path.clone()) {
println!("{}", canonical.display());

let resources: Vec<String> = deserialize(canonical.clone())
.iter()
.map(|doc| doc.resources.clone())
.flatten()
.collect();

for r in resources {
let mut next_path = canonical
.parent()
.unwrap()
.to_path_buf();
next_path.push(PathBuf::from(r));

let mut branch = result.clone();

branch.push(canonical.clone());
run(next_path, branch);
};
};
}

Expand Down

0 comments on commit 341c403

Please sign in to comment.