tools: Only run tools on files with the right type.
This commit is contained in:
parent
dbe4db26c8
commit
6b9dddcbd2
1 changed files with 2 additions and 0 deletions
|
|
@ -738,6 +738,8 @@ def url_of_tool(tool):
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
tool_name, path = sys.argv[1:3]
|
tool_name, path = sys.argv[1:3]
|
||||||
tool = locals()[tool_name]
|
tool = locals()[tool_name]
|
||||||
|
valid_tools = tools_for_path(path)
|
||||||
|
assert tool in valid_tools, valid_tools
|
||||||
status, text = run_tool_no_error(path, tool)
|
status, text = run_tool_no_error(path, tool)
|
||||||
print(text)
|
print(text)
|
||||||
sys.exit(0 if status in [Status.ok, Status.normal] else 1)
|
sys.exit(0 if status in [Status.ok, Status.normal] else 1)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue