Skip to content

Commit

Permalink
Fix credentials checking bug
Browse files Browse the repository at this point in the history
  • Loading branch information
crabvk committed Sep 25, 2023
1 parent 7e47ff7 commit 46fddbe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions bar_gmail/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ def cli():
if not CACHE_DIR.is_dir():
CACHE_DIR.mkdir(exist_ok=True)

if not CREDENTIALS_PATH.is_file():
print('Credentials not found. Run `bar-gmail auth` for authentication.', file=sys.stderr)
exit(1)

gmail = Gmail(CLIENT_SECRETS_PATH, CREDENTIALS_PATH)

if args.subcommand == 'auth':
if gmail.authenticate():
print('Authenticated successfully.')
exit()

if not CREDENTIALS_PATH.is_file():
print('Credentials not found. Run `bar-gmail auth` for authentication.', file=sys.stderr)
exit(1)

if args.subcommand == 'labels':
for label in gmail.get_labels():
print(label)
Expand Down
1 change: 1 addition & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build:
rm -rf ./dist
poetry build

install:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "bar-gmail"
version = "1.0.1"
version = "1.0.2"
description = "Get notifications and unread messages count from Gmail (Waybar/Polybar module)"
license = "MIT"
readme = "README.md"
Expand Down

0 comments on commit 46fddbe

Please sign in to comment.