fix list-repo-token
This commit is contained in:
parent
7abe6a3097
commit
0c8b87734a
|
@ -41,7 +41,6 @@ def listRepos(provider_git, team_org, verbose = False):
|
||||||
response = requests.get(page_url)
|
response = requests.get(page_url)
|
||||||
page_json = response.json()
|
page_json = response.json()
|
||||||
repos = {}
|
repos = {}
|
||||||
print(page_url)
|
|
||||||
if provider_git == 'bitbucket':
|
if provider_git == 'bitbucket':
|
||||||
while page_url is not None:
|
while page_url is not None:
|
||||||
response = requests.get(page_url)
|
response = requests.get(page_url)
|
||||||
|
@ -131,6 +130,7 @@ class Gitea():
|
||||||
except Not_Connect:
|
except Not_Connect:
|
||||||
print("Fail")
|
print("Fail")
|
||||||
|
|
||||||
|
|
||||||
@click.command()
|
@click.command()
|
||||||
@click.option('--provider_git',
|
@click.option('--provider_git',
|
||||||
type=click.Choice([*__provider_git],
|
type=click.Choice([*__provider_git],
|
||||||
|
@ -145,11 +145,13 @@ def list_repo(provider_git, team_org, verbose):
|
||||||
@click.option('--domain', required=True)
|
@click.option('--domain', required=True)
|
||||||
@click.option('--team_org', required=True)
|
@click.option('--team_org', required=True)
|
||||||
@click.option('--access_token', default=None)
|
@click.option('--access_token', default=None)
|
||||||
def list_repo_token(domain, team_org, access_token):
|
@click.option('--verbose', default=False)
|
||||||
|
def list_repo_token(domain, team_org,
|
||||||
|
access_token, verbose):
|
||||||
HOST = "https://%s/api/v1" % (domain)
|
HOST = "https://%s/api/v1" % (domain)
|
||||||
HEADERS = { "accept": "application/json", "content-type": "application/json" }
|
HEADERS = { "accept": "application/json", "content-type": "application/json" }
|
||||||
HEADERS["Authorization"] = "token %s" % (access_token)
|
HEADERS["Authorization"] = "token %s" % (access_token)
|
||||||
Gitea.listRepo(host = HOST, team = team_org, headers = HEADERS)
|
Gitea.listRepo(HOST, team_org, HEADERS, verbose)
|
||||||
|
|
||||||
@click.command()
|
@click.command()
|
||||||
@click.option('--domain', required=True)
|
@click.option('--domain', required=True)
|
||||||
|
|
Loading…
Reference in New Issue