mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2026-02-10 19:50:28 +08:00
fix: add force option to file copy to prevent first launch failures
This commit is contained in:
parent
0198630e57
commit
34d2b31579
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user