Skip to content

Commit d3964aa

Browse files
committed
Dactyl v0.6.2: better error on duplicate targets
1 parent 5c9ee0b commit d3964aa

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

dactyl/dactyl_build.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,16 @@ def load_config(config_file=DEFAULT_CONFIG_FILE, bypass_errors=False):
9696

9797
config.update(loaded_config)
9898

99-
targetnames = set([t["name"] for t in config["targets"]])
100-
if len(targetnames) != len(config["targets"]):
101-
recoverable_error("Duplicate or missing target name in config file",
102-
bypass_errors)
99+
targetnames = set()
100+
for t in config["targets"]:
101+
if "name" not in t:
102+
logger.error("Target does not have required 'name' field: %s" % t)
103+
exit(1)
104+
elif t["name"] in targetnames:
105+
recoverable_error("Duplicate target name in config file: '%s'" %
106+
t["name"], bypass_errors)
107+
targetnames.add(t["name"])
108+
103109
# Check page list for consistency and provide default values
104110
for page in config["pages"]:
105111
if "targets" not in page:

dactyl/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.6.1'
1+
__version__ = '0.6.2'

0 commit comments

Comments
 (0)