Mercurial > code > home > repos > reposync
comparison sync_to_github.py @ 7:7f479502a8ab
wip sync_to_github (from hg)
author | drewp@bigasterisk.com |
---|---|
date | Fri, 16 Jul 2021 00:05:25 -0700 |
parents | |
children | cc3321b8adc1 |
comparison
equal
deleted
inserted
replaced
6:a0d9679c4f4a | 7:7f479502a8ab |
---|---|
1 #!/usr/bin/python3 | |
2 from pathlib import Path | |
3 import json | |
4 | |
5 from github import Github | |
6 from sync import Project, getSshAuthSock | |
7 | |
8 config = json.loads(open("config.json").read()) | |
9 config['SSH_AUTH_SOCK'] = getSshAuthSock() | |
10 | |
11 # to get this token: | |
12 # curl -u drewp https://api.github.com/authorizations -d '{"scopes":["repo"]}' | |
13 # from http://developer.github.com/v3/oauth/#oauth-authorizations-api | |
14 gh = Github(config['gitHubToken']).get_user() | |
15 | |
16 p = Project(config, gh, Path('.').absolute()) | |
17 p.makeGitHubRepo() | |
18 p.hgToGitHub() |