Skip to content

Commit

Permalink
Add error message when build script is not found (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasRosenstein committed Sep 13, 2018
1 parent 45fced0 commit dca2688
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/craftr/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,11 @@ def main(argv=None, prog=None):

graph_file = nr.fs.join(session.build_root, 'craftr_graph.{}.json'.format(session.build_variant))
if args.config:
session.load_module_from_file(args.project, is_main=True)
try:
session.load_module_from_file(args.project, is_main=True)
except FileNotFoundError as e:
print('fatal: "{}" file not found'.format(nr.fs.rel(e.filename)), file=sys.stderr)
return 1
nr.fs.makedirs(nr.fs.dir(graph_file))
session.save(graph_file)
else:
Expand Down

0 comments on commit dca2688

Please sign in to comment.