File tree Expand file tree Collapse file tree 1 file changed +21
-5
lines changed
Expand file tree Collapse file tree 1 file changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -33,18 +33,34 @@ def remove_templates() -> None:
3333 rmtree (context_path )
3434
3535
36+ def remove_github_workflow () -> None :
37+ workflow_path = CONTEXT .joinpath ('.github' , 'workflows' , 'python-app-code.yml' )
38+ if workflow_path .exists ():
39+ remove (workflow_path )
40+
41+ github_dir = CONTEXT .joinpath ('.github' , 'workflows' )
42+ if github_dir .exists () and not any (github_dir .iterdir ()):
43+ rmtree (CONTEXT .joinpath ('.github' ))
44+
45+
46+ def remove_test_auth () -> None :
47+ test_auth_path = CONTEXT .joinpath ('tests' , 'test_auth.py' )
48+ if test_auth_path .exists ():
49+ remove (test_auth_path )
50+
51+
3652def main ():
3753 if "{{ cookiecutter.use_mkdocs }}" != "y" :
3854 remove_mkdocs ()
3955
4056 if "{{ cookiecutter.use_templates }}" != "y" :
4157 remove_templates ()
4258
43- if "{{ cookiecutter.use_auth }}" = = "y" :
44- remove_endpoint ( file = 'item.py' )
45- rename_endpoint ( file = 'item_auth.py' , for_file = 'item.py' )
46- else :
47- remove_endpoint ( file = 'item_auth.py' )
59+ if "{{ cookiecutter.github_action_code_scan }}" ! = "y" :
60+ remove_github_workflow ( )
61+
62+ if "{{ cookiecutter.use_auth }}" == "n" :
63+ remove_test_auth ( )
4864
4965
5066if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments