Warn on bogus source names

This commit is contained in:
Tim Van Baak 2019-05-15 21:56:12 -07:00
parent 24a02f6faf
commit dea8fcd4d5
1 changed files with 8 additions and 1 deletions

View File

@ -46,7 +46,14 @@ def update(args):
logger.error("dungeon must be a directory") logger.error("dungeon must be a directory")
exit(-1) exit(-1)
sources = load_all_sources(args.srcdir) sources = load_all_sources(args.srcdir)
names = args.sources or [s.SOURCE for s in sources] source_names = [s.SOURCE for s in sources]
if args.sources:
names = args.sources
for name in names:
if name not in source_names:
logger.error("Source not found: {}".format(name))
else:
names = source_names
dungeon = Dungeon(args.dungeon) dungeon = Dungeon(args.dungeon)
for itemsource in sources: for itemsource in sources:
if itemsource.SOURCE in names: if itemsource.SOURCE in names: