Skip to content

Commit

Permalink
Fix for crates using relative license-file paths in the Cargo.toml. (#46
Browse files Browse the repository at this point in the history
)
  • Loading branch information
foresterre authored and Jake-Shadle committed Nov 22, 2019
1 parent 24746d7 commit cf45872
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/licenses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,11 @@ impl LicensePack {
// already found in the root directory
if let Some(ref lf) = krate.license_file {
if lic_paths.iter().find(|l| l.ends_with(lf)).is_none() {
lic_paths.push(lf.clone());
// The `krate.license_file` is relative to the crate, while files found with
// `find_license_files()` are absolute. We prepend the directory of the current
// crate, to make sure all license file paths will be absolute.
let absolute_lf = krate.manifest_path.parent().unwrap().join(lf);
lic_paths.push(absolute_lf);
}
}

Expand Down

0 comments on commit cf45872

Please sign in to comment.