From d3964aa0d07ff3e9b3792e187baf79bd2d2f7a6a Mon Sep 17 00:00:00 2001 From: mDuo13 Date: Thu, 8 Jun 2017 17:51:21 -0700 Subject: [PATCH] Dactyl v0.6.2: better error on duplicate targets --- dactyl/dactyl_build.py | 14 ++++++++++---- dactyl/version.py | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/dactyl/dactyl_build.py b/dactyl/dactyl_build.py index 2b39411..5b7c7d6 100755 --- a/dactyl/dactyl_build.py +++ b/dactyl/dactyl_build.py @@ -96,10 +96,16 @@ def load_config(config_file=DEFAULT_CONFIG_FILE, bypass_errors=False): config.update(loaded_config) - targetnames = set([t["name"] for t in config["targets"]]) - if len(targetnames) != len(config["targets"]): - recoverable_error("Duplicate or missing target name in config file", - bypass_errors) + targetnames = set() + for t in config["targets"]: + if "name" not in t: + logger.error("Target does not have required 'name' field: %s" % t) + exit(1) + elif t["name"] in targetnames: + recoverable_error("Duplicate target name in config file: '%s'" % + t["name"], bypass_errors) + targetnames.add(t["name"]) + # Check page list for consistency and provide default values for page in config["pages"]: if "targets" not in page: diff --git a/dactyl/version.py b/dactyl/version.py index 8411e55..aece342 100644 --- a/dactyl/version.py +++ b/dactyl/version.py @@ -1 +1 @@ -__version__ = '0.6.1' +__version__ = '0.6.2'