mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-13 05:06:58 +03:00
Fix the remove file problem
This commit is contained in:
parent
a65a750464
commit
c56e4ef616
|
@ -82,6 +82,11 @@ def make_secret_key(project_directory):
|
||||||
set_secret_key(env_file)
|
set_secret_key(env_file)
|
||||||
|
|
||||||
|
|
||||||
|
def remove_file(file_name):
|
||||||
|
if os.path.exists(file_name):
|
||||||
|
os.remove(file_name)
|
||||||
|
|
||||||
|
|
||||||
def remove_task_app(project_directory):
|
def remove_task_app(project_directory):
|
||||||
"""Removes the taskapp if celery isn't going to be used"""
|
"""Removes the taskapp if celery isn't going to be used"""
|
||||||
# Determine the local_setting_file_location
|
# Determine the local_setting_file_location
|
||||||
|
@ -111,9 +116,8 @@ def remove_heroku_files():
|
||||||
Removes files needed for heroku if it isn't going to be used
|
Removes files needed for heroku if it isn't going to be used
|
||||||
"""
|
"""
|
||||||
for filename in ["app.json", "Procfile", "requirements.txt", "runtime.txt"]:
|
for filename in ["app.json", "Procfile", "requirements.txt", "runtime.txt"]:
|
||||||
os.remove(os.path.join(
|
file_name = os.path.join(PROJECT_DIRECTORY, filename)
|
||||||
PROJECT_DIRECTORY, filename
|
remove_file(file_name)
|
||||||
))
|
|
||||||
|
|
||||||
|
|
||||||
def remove_docker_files():
|
def remove_docker_files():
|
||||||
|
@ -163,9 +167,8 @@ def remove_certbot_files():
|
||||||
"""
|
"""
|
||||||
nginx_dir_location = os.path.join(PROJECT_DIRECTORY, 'compose/nginx')
|
nginx_dir_location = os.path.join(PROJECT_DIRECTORY, 'compose/nginx')
|
||||||
for filename in ["nginx-secure.conf", "start.sh", "dhparams.example.pem"]:
|
for filename in ["nginx-secure.conf", "start.sh", "dhparams.example.pem"]:
|
||||||
os.remove(os.path.join(
|
file_name = os.path.join(nginx_dir_location, filename)
|
||||||
nginx_dir_location, filename
|
remove_file(file_name)
|
||||||
))
|
|
||||||
|
|
||||||
# IN PROGRESS
|
# IN PROGRESS
|
||||||
# def copy_doc_files(project_directory):
|
# def copy_doc_files(project_directory):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user