From 60cc6434d961f05ad96022c8cf176f90a892a0f7 Mon Sep 17 00:00:00 2001 From: Siddharth Dushantha Date: Sat, 8 Aug 2020 18:56:50 +0200 Subject: [PATCH] added version checking If the there is a newer version available on GitHub then the user will be told. This to encourage users to have the up to date version of Sherlock which has the newest features. --- sherlock/sherlock.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sherlock/sherlock.py b/sherlock/sherlock.py index 91c723e1..6ac01fdc 100644 --- a/sherlock/sherlock.py +++ b/sherlock/sherlock.py @@ -493,6 +493,15 @@ def main(): args = parser.parse_args() + # Check for newer version of Sherlock. If it exists, let the user know about it + r = requests.get("https://raw.githubusercontent.com/sherlock-project/sherlock/master/sherlock/sherlock.py") + remote_version = str(re.findall('__version__ = "(.*)"', r.text)[0]) + local_version = __version__ + + if remote_version != local_version: + print("Update Available!\n" + + f"You are running version {local_version}. Version {remote_version} is available at https://git.io/sherlock") + # Argument check # TODO regex check on args.proxy