1
0
Fork 0
mirror of https://github.com/clockfort/GitHub-Backup.git synced 2025-03-09 00:00:03 +01:00

fix GitHub token not used when not password arg is not present

This commit is contained in:
bb1950328 2021-08-03 20:04:57 +02:00 committed by GitHub
parent e8cf9a6f2a
commit 39627e6acf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -71,14 +71,13 @@ def main():
args.backupdir = args.backupdir.rstrip("/")
# Make the connection to Github here.
config = {}
config = {'login_or_token': args.login_or_token}
if args.password == False:
# no password option given, continue unauthenticated
# unauthenticated users can only use http git method
args.type = 'http'
elif args.password == None:
# password option given, but no password value given
config = {'login_or_token': args.login_or_token}
if os.path.isfile(CONFFILE):
cfg = ConfigParser()
cfg.read(CONFFILE)
@ -91,7 +90,6 @@ def main():
if password:
config['password'] = password
else:
config = {'login_or_token': args.login_or_token}
config['password'] = args.password
LOGGER.debug("Github config: %r", config)