mirror of
https://github.com/purocean/yn.git
synced 2026-09-24 15:46:02 +08:00
refactor: replace backslashes with forward slashes in file path generation
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user