From 6085e13f0e4acf3506833087147036492e22502e Mon Sep 17 00:00:00 2001 From: Bero Date: Mon, 6 Jan 2025 11:32:39 +0100 Subject: [PATCH] Add icons to folder if it already exists --- build_pwa.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build_pwa.py b/build_pwa.py index d43e8d0..114987b 100644 --- a/build_pwa.py +++ b/build_pwa.py @@ -47,9 +47,10 @@ def build_pwa_for_folder(folder_path): icons_dir = os.path.join(folder_path, 'icons') if not os.path.exists(icons_dir): os.makedirs(icons_dir) - # Copy default icons - default_icons_dir = os.path.join(TEMPLATE_DIR, 'icons') - for icon in os.listdir(default_icons_dir): + # Copy default icons if they don't exist + default_icons_dir = os.path.join(TEMPLATE_DIR, 'icons') + for icon in os.listdir(default_icons_dir): + if not os.path.exists(os.path.join(icons_dir, icon)): shutil.copy(os.path.join(default_icons_dir, icon), icons_dir) def main():