fix: add force option to file copy to prevent first launch failures

This commit is contained in:
Memory 2025-12-31 20:26:04 +08:00 committed by GitHub
parent 0198630e57
commit 34d2b31579
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -161,14 +161,14 @@ async function initFiles(): Promise<void> {
const shouldCopyToWork =
!existsSync(targetPath) || (await isSourceNewer(sourcePath, targetPath))
if (shouldCopyToWork) {
await cp(sourcePath, targetPath, { recursive: true })
await cp(sourcePath, targetPath, { recursive: true, force: true })
}
}
if (existsSync(sourcePath)) {
const shouldCopyToTest =
!existsSync(testTargetPath) || (await isSourceNewer(sourcePath, testTargetPath))
if (shouldCopyToTest) {
await cp(sourcePath, testTargetPath, { recursive: true })
await cp(sourcePath, testTargetPath, { recursive: true, force: true })
}
}
} catch (error) {