mirror of
https://github.com/pompurin404/mihomo-party.git
synced 2024-11-15 19:22:31 +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…
Reference in New Issue
Block a user