Skip to content

Commit

Permalink
perf: Remove unwanted check (#788)
Browse files Browse the repository at this point in the history
`get_frappe_commands` returns a list of valid frappe commands which is used to check if the user command is valid. But this is unnecessary because even without it bench can report the command not found error. This saves ~1 second.
  • Loading branch information
surajshetty3416 authored and netchampfaris committed Apr 12, 2019
1 parent 2435cb6 commit 431e969
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bench/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def cli():
if len(sys.argv) > 2 and sys.argv[1] == "frappe":
return old_frappe_cli()

elif len(sys.argv) > 1 and sys.argv[1] in get_frappe_commands():
elif len(sys.argv) > 1:
return frappe_cmd()

elif len(sys.argv) > 1 and sys.argv[1] in ("--site", "--verbose", "--force", "--profile"):
Expand Down

2 comments on commit 431e969

@seethersan
Copy link

@seethersan seethersan commented on 431e969 Apr 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change breaks all bench commands.
image
the code never reach the else condition where the bench_command is.

@netchampfaris
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seethersan Yes, we have reverted the change.

Please sign in to comment.