mirror of
https://github.com/clockfort/GitHub-Backup.git
synced 2025-03-09 00:00:03 +01:00
Add ability to clone over SSH protocol.
This commit is contained in:
parent
3942eb1f93
commit
5336a70f45
1 changed files with 2 additions and 1 deletions
|
@ -56,6 +56,7 @@ def init_parser():
|
|||
parser.add_argument("-p", "--password", help="Authenticate with Github API")
|
||||
parser.add_argument("-P","--prefix", help="Add prefix to repository directory names", default="")
|
||||
parser.add_argument("-o","--organization", help="Backup Organizational repositories")
|
||||
parser.add_argument("-S","--ssh", help="Use SSH protocol", action="store_true")
|
||||
|
||||
return parser
|
||||
|
||||
|
@ -81,7 +82,7 @@ def clone_repo(repo, dir, args):
|
|||
else:
|
||||
options = args.git
|
||||
|
||||
os.system('git clone %s %s %s'%(options, repo.git_url, dir))
|
||||
os.system('git clone %s %s %s'%(options, repo.ssh_url if args.ssh else repo.git_url, dir))
|
||||
|
||||
|
||||
def update_repo(repo, dir, args):
|
||||
|
|
Loading…
Add table
Reference in a new issue