Skip to content

Commit 76ddab1

Browse files
fix(utils): sanitize filenames for Windows compatibility
1 parent ee44124 commit 76ddab1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/downloadUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ async function singleDownload(workId: number) {
151151
};
152152
};
153153
await fs.promises.mkdir(
154-
path.dirname(path.join(argvUtils.getArgv().outputDir, stringUtils.numberToRJIdString(workId), entryObj.path)),
154+
path.dirname(path.join(argvUtils.getArgv().outputDir, stringUtils.numberToRJIdString(workId), fixFilenameOnWindows(entryObj.path))),
155155
{
156156
recursive: true,
157157
},
@@ -160,7 +160,7 @@ async function singleDownload(workId: number) {
160160
// recursive: true,
161161
// });
162162
const writer = fs.createWriteStream(
163-
path.join(argvUtils.getArgv().outputDir, stringUtils.numberToRJIdString(workId), entryObj.path),
163+
path.join(argvUtils.getArgv().outputDir, stringUtils.numberToRJIdString(workId), fixFilenameOnWindows(entryObj.path)),
164164
);
165165
// const writer = fs.createWriteStream(
166166
// path.join(argvUtils.getArgv().outputDir, entryObj.uuid + path.extname(entryObj.path)),

0 commit comments

Comments
 (0)