| Index: third_party/WebKit/Tools/Scripts/wpt-export
|
| diff --git a/third_party/WebKit/Tools/Scripts/wpt-export b/third_party/WebKit/Tools/Scripts/wpt-export
|
| index 0b3e4aee694825692f8b699990b2a31667c17373..f9b3f2bf83a67f15aab5ba038e4ace08235bede1 100755
|
| --- a/third_party/WebKit/Tools/Scripts/wpt-export
|
| +++ b/third_party/WebKit/Tools/Scripts/wpt-export
|
| @@ -11,6 +11,7 @@ repository.
|
| """
|
|
|
| import argparse
|
| +import json
|
| import logging
|
|
|
| from webkitpy.common.host import Host
|
| @@ -30,23 +31,34 @@ def main():
|
| help='See what would be done without actually creating or merging '
|
| 'any pull requests.')
|
| parser.add_argument(
|
| - '--user',
|
| + '--gh-user',
|
| help='GitHub user name. Can also be provided using the GH_USER '
|
| 'environment variable.')
|
| parser.add_argument(
|
| - '--token',
|
| + '--gh-token',
|
| help='GitHub token or password. Can also be provided using the GH_TOKEN '
|
| 'environment variable.')
|
| + parser.add_argument(
|
| + '--github-credentials-json',
|
| + help='A JSON file with schema {"GH_USER": "", "GH_TOKEN": ""}. '
|
| + 'This will override credentials that were passed via command line or env var.')
|
| args = parser.parse_args()
|
| host = Host()
|
| - if not args.user:
|
| +
|
| + if not args.gh_user:
|
| args.user = host.environ.get('GH_USER')
|
| - if not args.token:
|
| - args.token = host.environ.get('GH_TOKEN')
|
| - if not (args.user and args.token):
|
| - parser.error('Must provide both user and token for GitHub.')
|
| + if not args.gh_token:
|
| + args.gh_token = host.environ.get('GH_TOKEN')
|
| + if args.github_credentials_json:
|
| + with open(args.github_credentials_json, 'r') as f:
|
| + contents = json.load(f)
|
| + args.gh_user = contents['GH_USER']
|
| + args.gh_token = contents['GH_TOKEN']
|
| +
|
| + if not (args.gh_user and args.gh_token):
|
| + parser.error('Must provide both gh_user and gh_token for GitHub.')
|
|
|
| - wpt_github = WPTGitHub(host, args.user, args.token)
|
| + wpt_github = WPTGitHub(host, args.gh_user, args.gh_token)
|
| test_exporter = TestExporter(host, wpt_github, dry_run=args.dry_run)
|
|
|
| test_exporter.run()
|
|
|