Skip to content

Commit 805ade2

Browse files
generate-copyright: Skip cargo vendor if folder exists
1 parent bfe7db9 commit 805ade2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/tools/generate-copyright/src/cargo_metadata.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,13 @@ pub fn get_metadata_and_notices(
5858
) -> Result<BTreeMap<Package, PackageMetadata>, Error> {
5959
let mut output = get_metadata(cargo, root_path, manifest_paths)?;
6060

61-
// Now do a cargo-vendor and grab everything
62-
println!("Vendoring deps into {}...", vendor_path.display());
63-
run_cargo_vendor(cargo, &vendor_path, manifest_paths)?;
61+
if vendor_path.exists() {
62+
println!("{} exists, skipping `cargo vendor` call", vendor_path.display());
63+
} else {
64+
// Now do a cargo-vendor and grab everything
65+
println!("{} missing, running `cargo vendor` to populate it", vendor_path.display());
66+
run_cargo_vendor(cargo, &vendor_path, manifest_paths)?;
67+
}
6468

6569
// Now for each dependency we found, go and grab any important looking files
6670
for (package, metadata) in output.iter_mut() {

0 commit comments

Comments
 (0)