Skip to content

Commit

Permalink
Added possibility to call amend/try-amend multiple times from easys…
Browse files Browse the repository at this point in the history
…tack
  • Loading branch information
Crivella committed Oct 4, 2024
1 parent 8ff6ba0 commit fda5ca8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions easybuild/tools/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -2002,6 +2002,7 @@ def opts_dict_to_eb_opts(args_dict):
:return: a list of strings representing command-line options for the 'eb' command
"""

allow_multiple_calls = ['amend', 'try-amend']
_log.debug("Converting dictionary %s to argument list" % args_dict)
args = []
for arg in sorted(args_dict):
Expand All @@ -2011,6 +2012,14 @@ def opts_dict_to_eb_opts(args_dict):
prefix = '--'
option = prefix + str(arg)
value = args_dict[arg]

if str(arg) in allow_multiple_calls:
if not isinstance(value, (list, tuple)):
value = [value]
for v in value:
args.append(option + '=' + str(v))
continue

if isinstance(value, (list, tuple)):
value = ','.join(str(x) for x in value)

Expand Down

0 comments on commit fda5ca8

Please sign in to comment.