7
|
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()
|