diff options
| author | rmspeers <ryan@riverloopsecurity.com> | 2018-11-28 21:11:03 -0500 |
|---|---|---|
| committer | Jordan <jordan@psifertex.com> | 2018-11-29 00:01:10 -0500 |
| commit | b5abb8b1e1b053c5d3ddd391469edc3ed02aa22c (patch) | |
| tree | d556192a229f7270f3fd8ffc53e3538bd6bef06d /scripts/install_api.py | |
| parent | 161786fc483515615399ba990254fba8d7d42876 (diff) | |
Updates for Python3 headless install.
Diffstat (limited to 'scripts/install_api.py')
| -rwxr-xr-x | scripts/install_api.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/install_api.py b/scripts/install_api.py index 2eca2292..1237e1e5 100755 --- a/scripts/install_api.py +++ b/scripts/install_api.py @@ -7,6 +7,11 @@ import sys import os from site import getsitepackages, getusersitepackages, check_enableusersite +# Hacky command line parsing to accept a silent-install -s flag like linux-setup.sh: +INTERACTIVE = True +if '-s' in sys.argv[1:]: + INTERACTIVE = False + try: import binaryninja print("Binary Ninja API already Installed") @@ -51,9 +56,12 @@ def validate_path(path): while not validate_path(api_path): - print("\nBinary Ninja not found. Please provide the path to Binary " + \ - "Ninja's install directory: \n [{}] : ".format(api_path)) + print("\nBinary Ninja not found.") + if not INTERACTIVE: + print("Non-interactive mode selected, failing.") + sys.exit(-1) + print("Please provide the path to Binary Ninja's install directory: \n [{}] : ".format(api_path)) new_path = sys.stdin.readline().strip() if len(new_path) == 0: print("\nInvalid path") |
