mirror of
https://github.com/hastagAB/Awesome-Python-Scripts.git
synced 2024-11-27 22:11:07 +00:00
25 lines
620 B
Python
25 lines
620 B
Python
|
import sys
|
||
|
import os
|
||
|
from github import Github
|
||
|
from dotenv import load_dotenv
|
||
|
|
||
|
load_dotenv()
|
||
|
|
||
|
path = os.getenv("FILEPATH")
|
||
|
username = os.getenv("USERNAME")
|
||
|
password = os.getenv("PASSWORD")
|
||
|
|
||
|
def create():
|
||
|
folderName = str(sys.argv[1])
|
||
|
folderpath = os.path.join(path,folderName)
|
||
|
if os.path.exists(folderpath):
|
||
|
print("Folder already exists.. Link to the path - "+ folderpath)
|
||
|
os.makedirs(folderpath)
|
||
|
user = Github(username, password).get_user()
|
||
|
repo = user.create_repo(sys.argv[1])
|
||
|
print("Succesfully created repository {}".format(sys.argv[1]))
|
||
|
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
create()
|