test rmtree

This commit is contained in:
2024-07-09 10:49:18 +02:00
committed by Flo Greistorfer
parent 8e374d7396
commit 7f5c7d80d5

View File

@@ -123,6 +123,8 @@ 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"))
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"))
@@ -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: