Skip to content

Instantly share code, notes, and snippets.

@jamesshah
Created October 5, 2019 08:44
Show Gist options
  • Save jamesshah/a62f59e04fb19531f682c22d757c39fe to your computer and use it in GitHub Desktop.
Save jamesshah/a62f59e04fb19531f682c22d757c39fe to your computer and use it in GitHub Desktop.
Project Initialization Automation using Python And Shell Script
#!/bin/bash
#shell script to automate project initialization
function create(){
cd
python ./automation1.py $1
cd path/to/your/projects/directory/$1
touch Readme.md
git init
git add .
git commit -m "first commit"
git remote add origin https://github.com/<your_git_username>/$1.git
git push -u origin master
code . #optional - opens up new directory in vs code
}
import sys
import os
from github import Github
path = "/path/to/your/desired/projects/directory"
def create():
folder_name = str(sys.argv[1])
os.makedirs(path+folder_name)
user = Github(username,password).get_user()
repo = user.create_repo(folder_name)
print(f"New Repository '{folder_name}' created successfully.")
if __name__ == "__main__":
create()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment