@@ -21,13 +21,30 @@ def copy_images(beman_repo_path: Path, website_repo_path: Path):
2121 Copy directory beman/images/ to /static/images/ for website build.
2222 Copy directory beman/images/ to / for previews in editors.
2323 """
24- beman_images_path = beman_repo_path / 'images'
25- target_directories = [
26- website_repo_path / 'images' ,
27- website_repo_path / 'static' / 'images' ,
24+ tasks = [
25+ {
26+ 'source' : beman_repo_path / 'images' ,
27+ 'target' : website_repo_path / 'images' ,
28+ },
29+ {
30+ 'source' : beman_repo_path / 'images' ,
31+ 'target' : website_repo_path / 'static' / 'images' ,
32+ },
33+ {
34+ 'source' : beman_repo_path / 'docs' / 'images' ,
35+ 'target' : website_repo_path / 'docs' / 'images' ,
36+ },
37+ {
38+ 'source' : beman_repo_path / 'docs' / 'images' ,
39+ 'target' : website_repo_path / 'static' / 'docs' / 'images' ,
40+ },
2841 ]
29- for target_directory in target_directories :
42+
43+ for task in tasks :
44+ beman_images_path = task ['source' ]
45+ target_directory = task ['target' ]
3046 print (f"Copying images from { beman_images_path } to { target_directory } " )
47+
3148 # Remove the target_directory if it exists and create it again.
3249 if target_directory .exists ():
3350 shutil .rmtree (target_directory )
0 commit comments