File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -392,6 +392,10 @@ def add_command(
392392def remove_command (to_remove : list ):
393393 config = CFBSConfig .get_instance ()
394394 config .warn_about_unknown_keys ()
395+ if not "build" in config :
396+ user_error (
397+ 'Cannot remove any modules because the "build" key is missing from cfbs.json'
398+ )
395399 modules = config ["build" ]
396400
397401 def _get_module_by_name (name ) -> dict :
@@ -478,7 +482,12 @@ def _clean_unused_modules(config=None):
478482 if not config :
479483 config = CFBSConfig .get_instance ()
480484 config .warn_about_unknown_keys ()
485+ if "build" not in config :
486+ log .warning ('No "build" key with modules - nothing to clean' )
487+ return 0
481488 modules = config ["build" ]
489+ if len (modules ) == 0 :
490+ return 0
482491
483492 def _someone_needs_me (this ) -> bool :
484493 if "added_by" not in this or this ["added_by" ] == "cfbs add" :
You can’t perform that action at this time.
0 commit comments