Skip to content

Commit

Permalink
Use append action for --extra option in json-maker
Browse files Browse the repository at this point in the history
A workaround for https://bugs.python.org/issue9338 .
Resolves issue #9
  • Loading branch information
kujeger committed Aug 31, 2018
1 parent fbc7636 commit 3c33893
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions json-maker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 3c33893

Please sign in to comment.