Skip to content

Commit 263fa12

Browse files
committed
refactor(filesystem): path joining logic creates double slashes
In packages/filesystem/utils.ts, the joinPath function adds a leading '/' to every path segment that doesn't already start with '/', which creates incorrect paths with double slashes like '//path1//path2' instead of '/path1/path2'. The logic incorrectly prepends '/' to values that already have it stripped. Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
1 parent 68beedb commit 263fa12

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/filesystem/utils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ export function joinPath(...paths: string[]): string {
55
continue;
66
}
77
if (!value.startsWith("/")) {
8-
value = `/${value}`;
8+
if (path) {
9+
value = `/${value}`;
10+
}
911
}
1012
if (value.endsWith("/")) {
1113
value = value.substring(0, value.length - 1);

0 commit comments

Comments
 (0)