mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 05:00:30 +08:00
avoid same file name
This commit is contained in:
parent
68aba2afc3
commit
9393d73640
@ -42,7 +42,11 @@ export async function fetchThemes(): Promise<void> {
|
||||
|
||||
export async function importThemes(files: string[]): Promise<void> {
|
||||
for (const file of files) {
|
||||
if (existsSync(file)) await copyFile(file, path.join(themesDir(), path.basename(file)))
|
||||
if (existsSync(file))
|
||||
await copyFile(
|
||||
file,
|
||||
path.join(themesDir(), `${new Date().getTime().toString(16)}-${path.basename(file)}`)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user