Skip to content

Commit

Permalink
Prepare for tagged version checking
Browse files Browse the repository at this point in the history
  • Loading branch information
ppfeister committed Jul 1, 2024
1 parent e3a4879 commit 99586a5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
3 changes: 3 additions & 0 deletions sherlock/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@
__shortname__ = "Sherlock"
__longname__ = "Sherlock: Find Usernames Across Social Networks"
__version__ = "0.15.0"

forgeReleaseUrlPrefix = "https://github.com/sherlock-project/sherlock/releases/tag/"
forgeApiLatestReleaseUrl = "https://api.github.com/repos/sherlock-project/sherlock/releases/latest"
16 changes: 11 additions & 5 deletions sherlock/sherlock.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@
from requests_futures.sessions import FuturesSession
from torrequest import TorRequest

from sherlock.__init__ import __longname__, __shortname__, __version__
from sherlock.__init__ import (
__longname__,
__shortname__,
__version__,
forgeReleaseUrlPrefix,
#forgeApiLatestReleaseUrl,
)

from sherlock.result import QueryStatus
from sherlock.result import QueryResult
from sherlock.notify import QueryNotify
Expand Down Expand Up @@ -666,12 +673,11 @@ def main():
)

remote_version = str(re.findall('__version__ *= *"(.*)"', r.text)[0])
local_version = __version__

if remote_version != local_version:
if remote_version != __version__:
print(
"Update Available!\n"
+ f"You are running version {local_version}. Version {remote_version} is available at https://github.com/sherlock-project/sherlock"
f"Update available! {__version__} --> {remote_version}"
f"\n{forgeReleaseUrlPrefix}v{remote_version}"
)

except Exception as error:
Expand Down

0 comments on commit 99586a5

Please sign in to comment.