From 9393d7364056ce5085b17740d304f90a1deb0147 Mon Sep 17 00:00:00 2001 From: pompurin404 Date: Fri, 20 Sep 2024 15:23:01 +0800 Subject: [PATCH] avoid same file name --- src/main/resolve/theme.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/resolve/theme.ts b/src/main/resolve/theme.ts index 9eb4872..f5701b0 100644 --- a/src/main/resolve/theme.ts +++ b/src/main/resolve/theme.ts @@ -42,7 +42,11 @@ export async function fetchThemes(): Promise { export async function importThemes(files: string[]): Promise { 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)}`) + ) } }