Skip to content

Commit

Permalink
Fix bug in INITREMOTE
Browse files Browse the repository at this point in the history
Fix #47
  • Loading branch information
Lykos153 committed Jun 10, 2020
1 parent 174c17f commit 0f99bfb
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions git_annex_remote_googledrive/google_remote.py
Expand Up @@ -232,12 +232,19 @@ def initremote(self):
try:
with token_file.open('r') as fp:
credentials = fp.read()
except:
except Exception as e:
if token_config:
raise RemoteError("Could not read token file {}:".format(token_file), e)
self.annex.debug("Error reading token file at {}".format(token_file),
e,
" Trying embedded credentials")
credentials = None

if credentials is None:
if not self.credentials:
raise RemoteError("No Credentials found. Run 'git-annex-remote-googledrive setup' in order to authenticate.")
if not credentials:
credentials = self.credentials

if not credentials:
raise RemoteError("No Credentials found. Run 'git-annex-remote-googledrive setup' in order to authenticate.")


if self.annex.getconfig('exporttree') == 'yes':
Expand Down

0 comments on commit 0f99bfb

Please sign in to comment.