fix(package): Normalize cargo.toml to Cargo.toml for windows

This commit is contained in:
Ed Page 2023-07-24 16:01:59 -05:00
parent 5dd39df6f1
commit bbb6aff67a
2 changed files with 9 additions and 6 deletions

View File

@ -239,15 +239,17 @@ fn build_ar_list(
})?
.to_string();
match rel_str.as_ref() {
"Cargo.toml" => {
"Cargo.toml" |
// normalize for case insensitive filesystems (like on Windows)
"cargo.toml" => {
result.push(ArchiveFile {
rel_path: PathBuf::from(ORIGINAL_MANIFEST_FILE),
rel_str: ORIGINAL_MANIFEST_FILE.to_string(),
contents: FileContents::OnDisk(src_file),
});
result.push(ArchiveFile {
rel_path,
rel_str,
rel_path: PathBuf::from("Cargo.toml"),
rel_str: "Cargo.toml".to_string(),
contents: FileContents::Generated(GeneratedFile::Manifest),
});
}

View File

@ -3016,7 +3016,7 @@ See [..]
[VERIFYING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 ([CWD][..])
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] 3 files, [..] ([..] compressed)
[PACKAGED] 4 files, [..] ([..] compressed)
",
)
.run();
@ -3025,7 +3025,8 @@ See [..]
.with_stdout(
"\
Cargo.lock
cargo.toml
Cargo.toml
Cargo.toml.orig
src/main.rs
",
)
@ -3036,7 +3037,7 @@ src/main.rs
validate_crate_contents(
f,
"foo-0.0.1.crate",
&["Cargo.lock", "cargo.toml", "src/main.rs"],
&["Cargo.lock", "Cargo.toml", "Cargo.toml.orig", "src/main.rs"],
&[],
);
}