Skip to content

Commit

Permalink
Merge pull request #3 from dfinity/cmdindex
Browse files Browse the repository at this point in the history
cmd.index does not return -1 when not found.
  • Loading branch information
DFINITYManu authored Jul 1, 2024
2 parents 3f56980 + 038581c commit 78a7289
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions shared/dfinity/dre.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ def run(
if dry_run:
cmd.append("--dry-run")
if yes and not dry_run:
pos = cmd.index("propose")
if pos == -1:
cmd.append("--yes")
else:
try:
pos = cmd.index("propose")
cmd.insert(pos + 1, "--yes")
except ValueError:
cmd.append("--yes")

print("::group::DRE output")
if full_stdout:
Expand Down

0 comments on commit 78a7289

Please sign in to comment.