diff --git a/scripts/create_repo b/scripts/create_repo index 9d3c5fa..234d0ea 100644 --- a/scripts/create_repo +++ b/scripts/create_repo @@ -11,23 +11,18 @@ if not GITHUB_API_TOKEN: URL = "https://api.github.com/user/repos" -parser = argparse.ArgumentParser(description='creates a local repository linked with a remote repository') -parser.add_argument('path', - metavar='PATH', - type=str, +parser = argparse.ArgumentParser(description='creates a local repository linked with a remote repository') # noqa: E501 + +parser.add_argument('path', + metavar='PATH', + type=str, help='Enter the path for the new repository') -parser.add_argument('name', - metavar='NAME', - type=str, +parser.add_argument('name', + metavar='NAME', + type=str, help='Enter a name for the new repository') -parser.add_argument('-d', - '--description', - metavar='DESCRIPTION', - type=str, - help='Enter a description for the new repository') args = parser.parse_args() - name = args.name path = args.path @@ -42,8 +37,9 @@ os.system('git add . && git commit -m "initial commit"') conn = http.client.HTTPSConnection("api.github.com") payload = json.dumps({ "name": name, - "description": "made with the GitHub API" + "description": "This is a modified description" # Modify the value here }) + headers = { 'Authorization': f'Bearer {GITHUB_API_TOKEN}', 'Content-Type': 'application/json',