Skip to content

Commit

Permalink
fix: fix updater thread never starting
Browse files Browse the repository at this point in the history
  • Loading branch information
pradishb committed May 30, 2024
1 parent 4f04aab commit 3410e3f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "yappr"
version = "1.0.6"
version = "1.0.7"
dependencies = []
requires-python = ">=3"
authors = [{ name = "Pradish Bijukchhe", email = "[email protected]" }]
Expand Down
9 changes: 6 additions & 3 deletions yappr/decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ def decorator(
def wrapped(*args: Param.args, **kwargs: Param.kwargs) -> None:
# Initialize updater, updater needs to start as
# soon as the script starts
parser = ArgumentParser()
parser = ArgumentParser(add_help=False)
parser.add_argument("--no-updater", action="store_true")
cmd_args, _ = parser.parse_known_args(["--no-updater"])
if not cmd_args.no_updater:
parser.add_argument("-h", "--help", action="store_true")
parser.add_argument("-v", "--version", action="store_true")
cmd_args, _ = parser.parse_known_args()
# do not run updater on help or version command
if not (cmd_args.no_updater or cmd_args.help or cmd_args.version):
Thread(target=updater.check_for_updates_loop).start()

while True:
Expand Down

0 comments on commit 3410e3f

Please sign in to comment.