|
4 | 4 | import shutil |
5 | 5 | import subprocess |
6 | 6 |
|
7 | | -from pygit2 import init_repository |
8 | 7 | from termcolor import cprint, colored |
9 | 8 | from pathlib import Path |
10 | 9 |
|
@@ -58,19 +57,16 @@ def replace_resources(): |
58 | 57 |
|
59 | 58 |
|
60 | 59 | def init_repo(): |
61 | | - repo_path = os.getcwd() |
62 | | - repo = init_repository(repo_path) |
| 60 | + subprocess.run(["git", "init"], stdout=subprocess.PIPE) |
63 | 61 | cprint("Git repository initialized.", "green") |
64 | | - repo.index.add_all() |
65 | | - repo.index.write() |
| 62 | + subprocess.run(["git", "add", "."], stdout=subprocess.PIPE) |
66 | 63 | cprint("Added files to index.", "green") |
67 | 64 | subprocess.run(["poetry", "install", "-n"]) |
68 | 65 | subprocess.run(["poetry", "run", "pre-commit", "install"]) |
69 | 66 | cprint("pre-commit installed.", "green") |
70 | 67 | subprocess.run(["poetry", "run", "pre-commit", "run", "-a"]) |
71 | | - repo.index.add_all() |
72 | | - repo.index.write() |
73 | | - |
| 68 | + subprocess.run(["git", "add", "."], stdout=subprocess.PIPE) |
| 69 | + subprocess.run(["git", "commit", "-m", "Initial commit"], stdout=subprocess.PIPE) |
74 | 70 |
|
75 | 71 | if __name__ == "__main__": |
76 | 72 | delete_resources_for_disabled_features() |
|
0 commit comments