refactor: replace backslashes with forward slashes in file path generation

This commit is contained in:
purocean
2024-10-09 12:40:37 +08:00
parent 1132c0fb71
commit 1ea67d3e02
+1 -1
View File
@@ -267,7 +267,7 @@ export async function upload (repo: string, buffer: Buffer, filePath: string, if
while (await exists(repo, newFilePath)) {
i++
const seq = i > 100 ? Math.floor(Math.random() * 1000000) : i
newFilePath = path.join(dir, base + `-${seq}` + ext)
newFilePath = path.join(dir, base + `-${seq}` + ext).replace(/\\/g, '/')
}
} else {
throw new Error('File exists')