Skip to content

Commit

Permalink
Move repo name to global var
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterEggnog committed Jul 26, 2022
1 parent 4167081 commit 123c991
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hooks/post_gen_project.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import sys

repo_name = '{{cookiecutter.repo_name }}'

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

def remove_main_if_lib():
is_lib = '{{ cookiecutter.binary }}'
main_file_path = os.path.join('{{ cookiecutter.repo_name }}', '__main__.py')
main_file_path = os.path.join(repo_name, '__main__.py')
if not (is_lib == "y" or is_lib == "Y"):
os.remove(main_file_path)

Expand Down

0 comments on commit 123c991

Please sign in to comment.