mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2026-02-11 04:00:32 +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 =
|
const shouldCopyToWork =
|
||||||
!existsSync(targetPath) || (await isSourceNewer(sourcePath, targetPath))
|
!existsSync(targetPath) || (await isSourceNewer(sourcePath, targetPath))
|
||||||
if (shouldCopyToWork) {
|
if (shouldCopyToWork) {
|
||||||
await cp(sourcePath, targetPath, { recursive: true })
|
await cp(sourcePath, targetPath, { recursive: true, force: true })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (existsSync(sourcePath)) {
|
if (existsSync(sourcePath)) {
|
||||||
const shouldCopyToTest =
|
const shouldCopyToTest =
|
||||||
!existsSync(testTargetPath) || (await isSourceNewer(sourcePath, testTargetPath))
|
!existsSync(testTargetPath) || (await isSourceNewer(sourcePath, testTargetPath))
|
||||||
if (shouldCopyToTest) {
|
if (shouldCopyToTest) {
|
||||||
await cp(sourcePath, testTargetPath, { recursive: true })
|
await cp(sourcePath, testTargetPath, { recursive: true, force: true })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user