From 3c338935ea498076fe6b67a0698e78582be3a10a Mon Sep 17 00:00:00 2001 From: Nikolai Vincent Vaags Date: Fri, 31 Aug 2018 17:54:16 +0200 Subject: [PATCH] Use append action for --extra option in json-maker A workaround for https://bugs.python.org/issue9338 . Resolves issue #9 --- json-maker.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/json-maker.py b/json-maker.py index cfca5ea..bff40ee 100755 --- a/json-maker.py +++ b/json-maker.py @@ -57,8 +57,9 @@ def main(): default='auto') parser.add_argument( '--extra', - nargs='*', - help="Additional installers to run (e.g. DLC)") + action='append', + default=[], + help="Additional installers to run (e.g. DLC). Can be used multiple times.") parser.add_argument( '--branch', help="Branch version. Use 'auto' to use the game version.", @@ -114,15 +115,14 @@ def main(): ]) ) - if args.extra: - for i, v in enumerate(args.extra): - jsondata['modules'][0]['sources'].append( - collections.OrderedDict([ - ("type", "file"), - ("path", v), - ("dest-filename", "installer-{}.sh".format(i+1)) - ]) - ) + for i, v in enumerate(args.extra): + jsondata['modules'][0]['sources'].append( + collections.OrderedDict([ + ("type", "file"), + ("path", v), + ("dest-filename", "installer-{}.sh".format(i+1)) + ]) + ) if not gameinfo['arch']: print(