tools: Let tools be run directly with tools.py
- Shows that tools work independantly of eris tui.
This commit is contained in:
parent
3dd4247f08
commit
58403d1466
1 changed files with 10 additions and 0 deletions
10
eris/tools.py
Normal file → Executable file
10
eris/tools.py
Normal file → Executable file
|
|
@ -1,3 +1,4 @@
|
|||
#!/usr/bin/python3.8
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2015-2019 Andrew Hamilton. All rights reserved.
|
||||
|
|
@ -17,6 +18,7 @@ import pwd
|
|||
import shutil
|
||||
import stat
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import time
|
||||
import traceback
|
||||
|
|
@ -731,3 +733,11 @@ def url_of_tool(tool):
|
|||
return url if url.startswith("http") else get_homepage_of_package(url)
|
||||
except AttributeError:
|
||||
return None
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
tool_name, path = sys.argv[1:3]
|
||||
tool = locals()[tool_name]
|
||||
status, text = run_tool_no_error(path, tool)
|
||||
print(text)
|
||||
sys.exit(0 if status in [Status.ok, Status.normal] else 1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue