Skip to content

Commit

Permalink
Added error message in case of build property missing from cfbs.json
Browse files Browse the repository at this point in the history
Ticket: CFE-3830
  • Loading branch information
craigcomstock committed Nov 1, 2021
1 parent 272aa17 commit f78e721
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 4 additions & 0 deletions cfbs/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ def get_definition() -> CFBSConfig:
definition = CFBSConfig()
if not definition:
user_error("Unable to read {}".format(cfbs_filename()))
if "build" not in definition:
user_error(
"missing 'build' key in cfbs.json, move aside and restart with 'cfbs init'"
)
return definition


Expand Down
4 changes: 0 additions & 4 deletions cfbs/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,6 @@ def save(self, data=None):
f.write(pretty(self._data) + "\n")

def _module_is_in_build(self, module):
if "build" not in self:
user_error(
"missing required 'build' key in cfbs.json, move aside and start over with 'cfbs init'"
)
return module["name"] in (m["name"] for m in self["build"])

def add(self, module, remote_config=None, dependent=None):
Expand Down

0 comments on commit f78e721

Please sign in to comment.