Merge pull request #711 from sherlock-project/add-error-checking-for-version-checking

added error checking while checking for updates
pull/713/head
Siddharth Dushantha 4 years ago committed by GitHub
commit 070b2363b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -494,7 +494,10 @@ def main():
args = parser.parse_args() args = parser.parse_args()
# Check for newer version of Sherlock. If it exists, let the user know about it # Check for newer version of Sherlock. If it exists, let the user know about it
try:
r = requests.get("https://raw.githubusercontent.com/sherlock-project/sherlock/master/sherlock/sherlock.py") r = requests.get("https://raw.githubusercontent.com/sherlock-project/sherlock/master/sherlock/sherlock.py")
remote_version = str(re.findall('__version__ = "(.*)"', r.text)[0]) remote_version = str(re.findall('__version__ = "(.*)"', r.text)[0])
local_version = __version__ local_version = __version__
@ -502,6 +505,9 @@ def main():
print("Update Available!\n" + print("Update Available!\n" +
f"You are running version {local_version}. Version {remote_version} is available at https://git.io/sherlock") f"You are running version {local_version}. Version {remote_version} is available at https://git.io/sherlock")
except Exception as error:
print(f"A problem occured while checking for an update: {error}")
# Argument check # Argument check
# TODO regex check on args.proxy # TODO regex check on args.proxy

Loading…
Cancel
Save