Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions .my_commands.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
#!/bin/bash

SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
function create() {
cd
source .env
python create.py $1
cd $FILEPATH$1
git init
git remote add origin git@github.com:$USERNAME/$1.git
touch README.md
git add .
git commit -m "Initial commit"
git push -u origin master
code .
cd $SCRIPTPATH
python3 create.py $1
}
9 changes: 6 additions & 3 deletions create.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
from github import Github
from dotenv import load_dotenv

import pygit2
load_dotenv()

path = os.getenv("FILEPATH")
Expand All @@ -11,10 +11,13 @@

def create():
folderName = str(sys.argv[1])
os.makedirs(path + str(folderName))
user = Github(username, password).get_user()
repo = user.create_repo(folderName)
print("Succesfully created repository {}".format(folderName))
repo.create_file("README.md", "Initial commit","")
repoClone = pygit2.clone_repository(repo.git_url, path + str(folderName))
print(f"Succesfully created repository {folderName}")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what for, I was going to create a pull request, why didn't @KalleHallden that .format just freaks me out.

os.chdir(path+str(folderName))
os.system("code .")

if __name__ == "__main__":
create()
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
selenium
PyGithub
python-dotenv
pygit2