-
Notifications
You must be signed in to change notification settings - Fork 263
Description
import sys
import os
from github import Github
path = "/home/cstevens/Documents/Code/"
username = "" #Insert your github username here
password = "" #Insert your github password here
password2 = "" #Insert your github web formated password here
def create():
folderName = str(sys.argv[1])
os.makedirs(path + str(sys.argv[1]))
user = Github(username, password).get_user()
repo = user.create_repo(sys.argv[1])
os. chdir(path + str(sys.argv[1]))
with open("README.md", "w") as text_file:
print("#Demo")
os.system("git init")
os.system("git add README.md")
os.system("git commit -m 'first commit'")
os.system("git remote add origin https://github.com/{0}/{1}.git".format(username,sys.argv[1]))
os.system("git push https://{0}:{1}@github.com/{0}/{2}.git --all".format(username,password2,sys.argv[1]))
print("Succesfully created repository {}".format(sys.argv[1]))
if name == "main":
create()