mirror of
https://github.com/hastagAB/Awesome-Python-Scripts.git
synced 2024-11-24 04:21:08 +00:00
27f2a0e8b6
Added gitAutomation to README.md refactoring
25 lines
620 B
Python
Executable File
25 lines
620 B
Python
Executable File
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()
|