Skip to content

Commit f328141

Browse files
committed
fix: Escape slashes in filenames
1 parent fc48634 commit f328141

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/util/common.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ export function extendedFetch(options, cookies) {
6060

6161

6262
export function safeJoin(...path) {
63-
path[path.length - 1] = os.platform() === 'win32' ? path[path.length - 1].replace(/[\/\\:*?"<>|]/g, '') : path[path.length - 1]
63+
const regex = os.platform() === 'win32' ? /[\/\\:*?"<>|]/g : /(\/|\\|:)/g
64+
path[path.length - 1] = path[path.length - 1].replace(regex, '')
6465
return join(...path)
6566
}
6667

0 commit comments

Comments
 (0)