Skip to content

Commit 1043c95

Browse files
committed
fix: delete files for docs/cli using hook
1 parent 6cd026a commit 1043c95

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

hooks/post_gen_project.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import os
2+
import shutil
3+
4+
# Remove docs files if not needed
5+
if '{{cookiecutter.include_docs}}' != 'y':
6+
if os.path.exists('docs'):
7+
shutil.rmtree('docs')
8+
if os.path.exists('mkdocs.yml'):
9+
os.remove('mkdocs.yml')
10+
11+
# Remove CLI file if not needed
12+
if '{{cookiecutter.include_cli}}' != 'y':
13+
cli_file = 'src/{{cookiecutter.package_name}}/__main__.py'
14+
if os.path.exists(cli_file):
15+
os.remove(cli_file)

{{cookiecutter.package_name}}/{% if cookiecutter.include_docs == 'y' %}docs{% endif %}/api.md renamed to {{cookiecutter.package_name}}/docs/api.md

File renamed without changes.

{{cookiecutter.package_name}}/{% if cookiecutter.include_docs == 'y' %}mkdocs.yml{% endif %} renamed to {{cookiecutter.package_name}}/mkdocs.yml

File renamed without changes.

{{cookiecutter.package_name}}/src/{{cookiecutter.package_name}}/{% if cookiecutter.include_cli == 'y' %}__main__.py{% endif %} renamed to {{cookiecutter.package_name}}/src/{{cookiecutter.package_name}}/__main__.py

File renamed without changes.

0 commit comments

Comments
 (0)