From 61bf0b94ddcceb777dde982c48c1372d3bb51bb7 Mon Sep 17 00:00:00 2001 From: Rob Cornish Date: Tue, 24 Sep 2013 19:55:38 +1000 Subject: [PATCH] Check project directory before processing args Patch stops the "Searching for Board description..." message occuring before the "No project found in this directory." message if we try to build outside of a valid project directory. --- ino/runner.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ino/runner.py b/ino/runner.py index 95d7592..f94a1df 100644 --- a/ino/runner.py +++ b/ino/runner.py @@ -55,16 +55,15 @@ def main(): args = parser.parse_args() try: - e.process_args(args) - - # Create a .build directory if required - valid_project = os.path.isdir(e.src_dir) run_anywhere = "init clean list-models serial" + in_project_dir = os.path.isdir(e.src_dir) + if not in_project_dir and current_command not in run_anywhere: + raise Abort("No project found in this directory.") + + e.process_args(args) + if current_command not in run_anywhere: - if not valid_project: - raise Abort("No project found in this directory.") - # For valid projects create .build & lib if not os.path.isdir(e.build_dir): os.makedirs(e.build_dir)