From 1e23898d6e695a187aae0b853aeaa6f674d9fd45 Mon Sep 17 00:00:00 2001 From: Silvio Ankermann Date: Wed, 27 May 2020 23:00:06 +0200 Subject: [PATCH] Check if setup is run inside git repo --- git_annex_remote_googledrive/run.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/git_annex_remote_googledrive/run.py b/git_annex_remote_googledrive/run.py index 815ccef..092f2d3 100644 --- a/git_annex_remote_googledrive/run.py +++ b/git_annex_remote_googledrive/run.py @@ -38,6 +38,11 @@ def _get_othertmp() -> os.PathLike: def setup(): + try: + token_file = _get_othertmp() / "git-annex-remote-googledrive.token" + except git.exc.InvalidGitRepositoryError: + print("ERROR: Needs to be run inside a git repository.") + return print("======") print("IMPORTANT: Google has started to lockdown their Google Drive API. This might affect access to your remotes.") print("Until this is settled you'll see a warning about this application not being verified by Google which you need to accept in order to proceed.")