From 7f5c7d80d5f8c3a547fbcd21e86cc3a9ff6e5a6b Mon Sep 17 00:00:00 2001 From: Flo Greistorfer Date: Tue, 9 Jul 2024 10:49:18 +0200 Subject: [PATCH] test rmtree --- builder.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/builder.py b/builder.py index 5a79e1b..0ac42c3 100755 --- a/builder.py +++ b/builder.py @@ -123,8 +123,10 @@ def copy_static_files(_args: Args) -> None: if os.path.exists(os.path.join(_args.root_directory, ".static")): print("Removing existing .static folder...") shutil.rmtree(os.path.join(_args.root_directory, ".static")) - shutil.copytree(STATIC_FILES_DIR, os.path.join(_args.root_directory, ".static"), dirs_exist_ok=True) - shutil.copyfile(_args.theme_path, os.path.join(_args.root_directory, ".static", "theme.css")) + if not os.path.exists(os.path.join(_args.root_directory, ".static")): + print("Copying static files...") + shutil.copytree(STATIC_FILES_DIR, os.path.join(_args.root_directory, ".static"), dirs_exist_ok=True) + shutil.copyfile(_args.theme_path, os.path.join(_args.root_directory, ".static", "theme.css")) def webmanifest(_args: Args) -> None: @@ -369,7 +371,6 @@ def main() -> None: if not os.path.exists(os.path.join(args.root_directory, ".thumbnails")): os.mkdir(os.path.join(args.root_directory, ".thumbnails")) - print("Copying static files...") copy_static_files(args) if args.generate_webmanifest: