Created
October 5, 2019 08:44
-
-
Save jamesshah/a62f59e04fb19531f682c22d757c39fe to your computer and use it in GitHub Desktop.
Project Initialization Automation using Python And Shell Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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