Skip to content

Commit a7cea4c

Browse files
committed
🐞fix: Changelog generator failed #1
auto add tag 0.1.0 to avoid the failure
1 parent 16165b4 commit a7cea4c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

docs/tutorial.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,6 @@ code:
171171
``` bash
172172
cd mypackage
173173

174-
# !!! uncomment the following line, if you didn't choose install pre-commit hooks at
175-
# last step. If you chose 'yes', then cookiecutter have already done that for you, since
176-
# pre-commit install need repo exist.
177-
178-
# git init
179174
git add .
180175
git commit -m "Initial skeleton."
181176
git branch -M main

hooks/post_gen_project.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,13 @@ def execute(*args, supress_exception = False):
2020
else:
2121
return out
2222

23-
def install_pre_commit_hooks():
23+
def init_git():
24+
# workaround for issue #1
2425
if not os.path.exists(os.path.join(PROJECT_DIRECTORY, ".git")):
2526
execute("git", "init")
27+
execute("git", "tag", "0.1.0")
2628

29+
def install_pre_commit_hooks():
2730
execute(sys.executable, "-m", "pip", "install", "pre-commit==2.12.0")
2831
execute("pre-commit", "install")
2932

@@ -40,6 +43,8 @@ def install_pre_commit_hooks():
4043
if 'Not open source' == '{{ cookiecutter.open_source_license }}':
4144
remove_file('LICENSE')
4245

46+
init_git()
47+
4348
if '{{ cookiecutter.install_precommit_hooks }}' == 'y':
4449
try:
4550
install_pre_commit_hooks()

0 commit comments

Comments
 (0)