Skip to content

Commit 123c991

Browse files
committed
Move repo name to global var
1 parent 4167081 commit 123c991

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

hooks/post_gen_project.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22
import sys
33

4+
repo_name = '{{cookiecutter.repo_name }}'
45

56
def set_python_version():
67
python_version = str(sys.version_info.major) + "." + str(sys.version_info.minor)
@@ -15,7 +16,7 @@ def set_python_version():
1516

1617
def remove_main_if_lib():
1718
is_lib = '{{ cookiecutter.binary }}'
18-
main_file_path = os.path.join('{{ cookiecutter.repo_name }}', '__main__.py')
19+
main_file_path = os.path.join(repo_name, '__main__.py')
1920
if not (is_lib == "y" or is_lib == "Y"):
2021
os.remove(main_file_path)
2122

0 commit comments

Comments
 (0)