Skip to content

Commit 6a859c0

Browse files
committed
added git init hook
1 parent c9a1d26 commit 6a859c0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

hooks/post_gen_project.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import webbrowser
2+
import os
3+
4+
gitinit = input("git init? [y]es / [n]o: ")
5+
if gitinit.lower() == 'y':
6+
# gitinit
7+
print("\ninitialized git repo")
8+
os.system("git init")
9+
10+
# open browser to create repo
11+
print("create remote Github repo")
12+
webbrowser.open('https://github.com/new', new=2)
13+
14+
# add remote
15+
remote = input("enter remote origin: ")
16+
os.system(f"git remote add origin {remote}")

0 commit comments

Comments
 (0)