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,8 +123,10 @@ def copy_static_files(_args: Args) -> None:
if os.path.exists(os.path.join(_args.root_directory, ".static")): if os.path.exists(os.path.join(_args.root_directory, ".static")):
print("Removing existing .static folder...") print("Removing existing .static folder...")
shutil.rmtree(os.path.join(_args.root_directory, ".static")) 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) if not os.path.exists(os.path.join(_args.root_directory, ".static")):
shutil.copyfile(_args.theme_path, os.path.join(_args.root_directory, ".static", "theme.css")) 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: def webmanifest(_args: Args) -> None:
@@ -369,7 +371,6 @@ def main() -> None:
if not os.path.exists(os.path.join(args.root_directory, ".thumbnails")): if not os.path.exists(os.path.join(args.root_directory, ".thumbnails")):
os.mkdir(os.path.join(args.root_directory, ".thumbnails")) os.mkdir(os.path.join(args.root_directory, ".thumbnails"))
print("Copying static files...")
copy_static_files(args) copy_static_files(args)
if args.generate_webmanifest: if args.generate_webmanifest: