@@ -32,10 +32,13 @@ def auto_add_readme(
3232 readme_name : str = "README.md" ,
3333 root_path : Optional [Path ] = Path .cwd (),
3434 prefix = "# " ,
35+ verbose : bool = True ,
3536) -> None :
3637 """
3738 Add a readme to the root_path if it does not exist
3839
40+ :param verbose:
41+ :type verbose:
3942 :param path:
4043 :param touch_mode:
4144 :param readme_name:
@@ -48,6 +51,8 @@ def auto_add_readme(
4851 readme_file = path / readme_name
4952 if not readme_file .exists ():
5053 readme_file .touch ()
54+ if verbose :
55+ print (f"Created { readme_file } " )
5156 if touch_mode == TouchModeEnum .breadcrumb :
5257 assert root_path is not None
5358 readme_file .write_text (prefix + str (path .relative_to (root_path )))
@@ -87,6 +92,7 @@ def recursive_add_readmes(
8792 touch_mode : TouchModeEnum = TouchModeEnum .breadcrumb ,
8893 readme_name : str = "README.md" ,
8994 root_path : Optional [Path ] = None ,
95+ verbose : bool = True ,
9096) -> None :
9197 """
9298 recursively add readmes to all children spanning from root_path
@@ -97,7 +103,11 @@ def recursive_add_readmes(
97103 root_path = path .parent
98104
99105 auto_add_readme (
100- path , touch_mode = touch_mode , readme_name = readme_name , root_path = root_path
106+ path ,
107+ touch_mode = touch_mode ,
108+ readme_name = readme_name ,
109+ root_path = root_path ,
110+ verbose = verbose ,
101111 )
102112
103113 for child in path .iterdir ():
@@ -109,6 +119,7 @@ def recursive_add_readmes(
109119 touch_mode = touch_mode ,
110120 readme_name = readme_name ,
111121 root_path = root_path ,
122+ verbose = verbose ,
112123 )
113124 elif child .is_file ():
114125 pass
0 commit comments