Skip to content

Commit 6b9f725

Browse files
committed
fix(#5): use path.posix.join to get posix style path on windows
1 parent 5861315 commit 6b9f725

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/utils/filename.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ const getFilename = (p) => path.posix.basename(p);
1616
* @type {string} path of folder
1717
* @param {string} p filename concat with path in posix style
1818
*/
19-
const getFolderPath = (p) => path.join(path.posix.dirname(p), path.posix.sep);
19+
const getFolderPath = (p) =>
20+
path.posix.join(path.posix.dirname(p), path.posix.sep);
2021

2122
/**
2223
* @type {string} base name
@@ -49,8 +50,8 @@ const getSubPaths = (p) => {
4950
if (folder) {
5051
acc.push(
5152
index === 0
52-
? path.join(folder, path.posix.sep)
53-
: path.join(acc[acc.length - 1], folder, path.posix.sep)
53+
? path.posix.join(folder, path.posix.sep)
54+
: path.posix.join(acc[acc.length - 1], folder, path.posix.sep)
5455
);
5556
}
5657
return acc;

0 commit comments

Comments
 (0)