Skip to content

Commit

Permalink
Fix IndexError in commands.py with just "mila"
Browse files Browse the repository at this point in the history
Signed-off-by: Fabrice Normandin <[email protected]>
  • Loading branch information
lebrice committed Aug 28, 2023
1 parent be04436 commit fe0cca2
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions milatools/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,20 @@ def main():
print("ERROR:", f"{err}", file=sys.stderr)
except Exception:
print(T.red(traceback.format_exc()), file=sys.stderr)
command = sys.argv[1] if len(sys.argv) > 1 else None
options = {
"labels": ",".join([sys.argv[1], mversion]),
"labels": ",".join([command, mversion] if command else [mversion]),
"template": "bug_report.md",
"title": f"[v{mversion}] Issue running the command `mila "
f"{sys.argv[1]}`",
"title": f"[v{mversion}] Issue running the command "
+ (f"`mila {command}`" if command else "`mila`"),
}
github_issue_url = (
f"https://github.com/mila-iqia/milatools/issues/new?{urlencode(options)}"
)
print(
T.bold_yellow(
f"An error occured during the execution of the command "
f"`{sys.argv[1]}`. "
f"`{command}`. "
)
+ T.yellow(
"Please try updating milatools by running\n"
Expand Down Expand Up @@ -107,10 +108,7 @@ def mila():
help="Milatools version",
)

subparsers = parser.add_subparsers(
required=True,
# parser_class=ArgumentParser,
)
subparsers = parser.add_subparsers()

# ----- mila docs ------

Expand Down

0 comments on commit fe0cca2

Please sign in to comment.