Skip to content

Commit

Permalink
feat(py): git init at post_gen_project
Browse files Browse the repository at this point in the history
  • Loading branch information
pplmx committed Aug 29, 2024
1 parent 5b819d6 commit 6f311b4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions template/py/hooks/post_gen_project.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import subprocess

# Initialize Git repository
try:
subprocess.run(["git", "init"], check=True)
except subprocess.CalledProcessError:
print("Failed to initialize Git repository. Please make sure Git is installed and try manually.")
except FileNotFoundError:
print("Git command not found. Please install Git and try again.")

0 comments on commit 6f311b4

Please sign in to comment.