mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-10 19:57:09 +03:00
Simplify post hook
This commit is contained in:
parent
4a1cdb5d25
commit
281dde1d1d
|
@ -72,22 +72,12 @@ def remove_heroku_files():
|
||||||
file_names = [
|
file_names = [
|
||||||
'Procfile',
|
'Procfile',
|
||||||
'runtime.txt',
|
'runtime.txt',
|
||||||
|
'requirements.txt',
|
||||||
]
|
]
|
||||||
for file_name in file_names:
|
for file_name in file_names:
|
||||||
remove_file(os.path.join(PROJECT_DIR_PATH, file_name))
|
remove_file(os.path.join(PROJECT_DIR_PATH, file_name))
|
||||||
|
|
||||||
|
|
||||||
def remove_paas_files():
|
|
||||||
none_paas_files_left = True
|
|
||||||
|
|
||||||
if '{{ cookiecutter.use_heroku }}'.lower() == 'n':
|
|
||||||
remove_heroku_files()
|
|
||||||
none_paas_files_left &= True
|
|
||||||
else:
|
|
||||||
none_paas_files_left &= False
|
|
||||||
|
|
||||||
if none_paas_files_left:
|
|
||||||
remove_file(os.path.join(PROJECT_DIR_PATH, 'requirements.txt'))
|
|
||||||
|
|
||||||
|
|
||||||
def remove_grunt_files():
|
def remove_grunt_files():
|
||||||
|
@ -250,7 +240,8 @@ def main():
|
||||||
if '{{ cookiecutter.use_docker }}'.lower() == 'n':
|
if '{{ cookiecutter.use_docker }}'.lower() == 'n':
|
||||||
remove_docker_files()
|
remove_docker_files()
|
||||||
|
|
||||||
remove_paas_files()
|
if '{{ cookiecutter.use_heroku }}'.lower() == 'n':
|
||||||
|
remove_heroku_files()
|
||||||
|
|
||||||
if '{{ cookiecutter.js_task_runner}}'.lower() == 'gulp':
|
if '{{ cookiecutter.js_task_runner}}'.lower() == 'gulp':
|
||||||
remove_grunt_files()
|
remove_grunt_files()
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
# This file is here because many Platforms as a Service look for
|
# This file is expected by Heroku.
|
||||||
# requirements.txt in the root directory of a project.
|
|
||||||
-r requirements/production.txt
|
-r requirements/production.txt
|
||||||
|
|
Loading…
Reference in New Issue
Block a user