Skip to content

Commit

Permalink
Merge pull request #61 from craigcomstock/CFE-3830
Browse files Browse the repository at this point in the history
CFE-3830 Added error message in case of build property missing from cfbs.json
  • Loading branch information
olehermanse committed Nov 1, 2021
2 parents 272aa17 + f78e721 commit a20aff4
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 a20aff4

Please sign in to comment.