avoid same file name

This commit is contained in:
pompurin404 2024-09-20 15:23:01 +08:00
parent 68aba2afc3
commit 9393d73640
No known key found for this signature in database

View File

@ -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)}`)
)
}
}