Added error checking for the root_path.
This commit is contained in:
parent
4040b5c807
commit
2230d78575
1 changed files with 6 additions and 0 deletions
6
vigil
6
vigil
|
|
@ -1076,6 +1076,12 @@ if __name__ == "__main__":
|
||||||
print(_get_help_text())
|
print(_get_help_text())
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
root_path = os.path.abspath(arguments["<root_path>"])
|
root_path = os.path.abspath(arguments["<root_path>"])
|
||||||
|
if not os.path.exists(root_path):
|
||||||
|
print("File does not exist:", root_path)
|
||||||
|
sys.exit(1)
|
||||||
|
if not os.path.isdir(root_path):
|
||||||
|
print("File is not a directory:", root_path)
|
||||||
|
sys.exit(1)
|
||||||
is_sandboxed = not arguments["--no-sandbox"]
|
is_sandboxed = not arguments["--no-sandbox"]
|
||||||
if is_sandboxed:
|
if is_sandboxed:
|
||||||
subprocess.call(["sudo", "-p", "Vigil needs sudo to create the filesy"
|
subprocess.call(["sudo", "-p", "Vigil needs sudo to create the filesy"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue