diff --git a/bar_gmail/__init__.py b/bar_gmail/__init__.py index 4284bfe..3da45e5 100644 --- a/bar_gmail/__init__.py +++ b/bar_gmail/__init__.py @@ -41,10 +41,6 @@ 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': @@ -52,6 +48,10 @@ def cli(): 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) diff --git a/justfile b/justfile index e5dc444..18095c9 100644 --- a/justfile +++ b/justfile @@ -1,4 +1,5 @@ build: + rm -rf ./dist poetry build install: diff --git a/pyproject.toml b/pyproject.toml index 550dfe5..61da66e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"