Skip to content

Commit

Permalink
Handle running outside a venv for the version command
Browse files Browse the repository at this point in the history
  • Loading branch information
thebeanogamer committed May 26, 2023
1 parent dee63d5 commit 10dc2bb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hstsparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ def date_round(date: datetime.datetime) -> datetime.datetime:
group.add_argument("--firefox", action="store_true", help="Process a Firefox database")
group.add_argument("--chrome", action="store_true", help="Process a Chrome database")

__version__ = importlib.metadata.version("hstsparser")
try:
__version__ = importlib.metadata.version("hstsparser")
except importlib.metadata.PackageNotFoundError:
__version__ = "0.0.1"

parser.add_argument('--version', action='version', version=f'%(prog)s {__version__}')

Expand Down

0 comments on commit 10dc2bb

Please sign in to comment.