Skip to content

Commit

Permalink
Bugfix: Reset token option immediately
Browse files Browse the repository at this point in the history
Fix #55
  • Loading branch information
Lykos153 committed Aug 31, 2020
1 parent 3b55388 commit 5e0136b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git_annex_remote_googledrive/google_remote.py
Expand Up @@ -221,6 +221,7 @@ def initremote(self):
raise RemoteError("Either prefix or root_id must be given.")

token_config = self.annex.getconfig('token')
self.annex.setconfig('token', "")
if token_config:
token_file = Path(token_config)
else:
Expand Down Expand Up @@ -255,7 +256,6 @@ def initremote(self):
except HasSubdirError:
raise RemoteError("Specified folder has subdirectories. Are you sure 'prefix' or 'id' is set correctly? In case you're migrating from gdrive or rclone, run 'git-annex-remote-googledrive migrate {prefix}' first.".format(prefix=prefix))

self.annex.setconfig('token', "")
self.annex.setconfig('root_id', self.root.id)
self.credentials = ''.join(self.root.json_creds().split())

Expand Down

0 comments on commit 5e0136b

Please sign in to comment.