mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
make sure dependency slashes are normalized
This commit is contained in:
@@ -4744,7 +4744,7 @@ pub const Package = extern struct {
|
||||
const workspace = dependency_version.value.workspace.slice(buf);
|
||||
const path = string_builder.append(String, if (strings.eqlComptime(workspace, "*")) "*" else brk: {
|
||||
var buf2: bun.PathBuffer = undefined;
|
||||
break :brk Path.relativePlatform(
|
||||
const rel = Path.relativePlatform(
|
||||
FileSystem.instance.top_level_dir,
|
||||
Path.joinAbsStringBuf(
|
||||
FileSystem.instance.top_level_dir,
|
||||
@@ -4758,6 +4758,8 @@ pub const Package = extern struct {
|
||||
.auto,
|
||||
false,
|
||||
);
|
||||
bun.path.dangerouslyConvertPathToPosixInPlace(u8, Path.relative_to_common_path_buf[0..rel.len]);
|
||||
break :brk rel;
|
||||
});
|
||||
if (comptime Environment.allow_assert) {
|
||||
assert(path.len() > 0);
|
||||
|
||||
@@ -307,7 +307,7 @@ pub fn longestCommonPathPosix(input: []const []const u8) []const u8 {
|
||||
return longestCommonPathGeneric(input, .posix);
|
||||
}
|
||||
|
||||
threadlocal var relative_to_common_path_buf: bun.PathBuffer = undefined;
|
||||
pub threadlocal var relative_to_common_path_buf: bun.PathBuffer = undefined;
|
||||
|
||||
/// Find a relative path from a common path
|
||||
// Loosely based on Node.js' implementation of path.relative
|
||||
|
||||
Reference in New Issue
Block a user