Skip to content

Commit

Permalink
Merge pull request #997 from charlespierce/skip_invalid_bins
Browse files Browse the repository at this point in the history
Filter out invalid bins when loading package manifest
  • Loading branch information
chriskrycho authored May 3, 2022
2 parents 781f23f + 87ce836 commit 1ad3d7c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/volta-core/src/tool/package/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,12 @@ mod serde_bins {
{
let mut bins = Vec::new();
while let Some((name, _)) = access.next_entry::<String, String>()? {
bins.push(name);
// Bin names that include path separators are invalid, as they would then point to
// other locations on the filesystem. To match the behavior of npm & Yarn, we
// filter those values out of the list of bins.
if !name.contains(&['/', '\\'][..]) {
bins.push(name);
}
}
Ok(bins)
}
Expand Down

0 comments on commit 1ad3d7c

Please sign in to comment.