Skip to content

Commit 87ce836

Browse files
committed
Filter out invalid bins when loading package manifest
1 parent 4567250 commit 87ce836

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

crates/volta-core/src/tool/package/metadata.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,12 @@ mod serde_bins {
261261
{
262262
let mut bins = Vec::new();
263263
while let Some((name, _)) = access.next_entry::<String, String>()? {
264-
bins.push(name);
264+
// Bin names that include path separators are invalid, as they would then point to
265+
// other locations on the filesystem. To match the behavior of npm & Yarn, we
266+
// filter those values out of the list of bins.
267+
if !name.contains(&['/', '\\'][..]) {
268+
bins.push(name);
269+
}
265270
}
266271
Ok(bins)
267272
}

0 commit comments

Comments
 (0)