File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ def remove_file(filepath):
16
16
17
17
plugin_type = "{{ cookiecutter.plugin_type }}" .lower ()
18
18
19
- if plugin_type == "postprocessor" :
20
- shutil .rmtree ("{{ cookiecutter.project_slug }}/importer" )
21
- else :
22
- shutil .rmtree ("{{ cookiecutter.project_slug }}/postprocessor" )
19
+ VALID_PLUGIN_TYPES = ["importer" , "diagnostic" , "ensemblestat" ]
20
+ # Remove the plugin type that was not selected
21
+ for plugin in VALID_PLUGIN_TYPES :
22
+ if plugin != plugin_type :
23
+ shutil .rmtree (f"{{ cookiecutter.project_slug }}/{ plugin } " )
Original file line number Diff line number Diff line change 13
13
# Exit to cancel project
14
14
sys .exit (1 )
15
15
16
+ VALID_PLUGIN_TYPES = ["importer" , "diagnostic" , "ensemblestat" ]
17
+
16
18
plugin_type = "{{ cookiecutter.plugin_type}}"
17
- if plugin_type != "importer" and plugin_type != "postprocessor" :
18
- print ('\n ERROR: The plugin_type must be "importer" or "postprocessor" ' )
19
- sys .exit (1 )
19
+ if plugin_type not in VALID_PLUGIN_TYPES :
20
+ print (f '\n ERROR: The plugin_type must be one of { ", " . join ( VALID_PLUGIN_TYPES ) } ' )
21
+ sys .exit (1 )
You can’t perform that action at this time.
0 commit comments