From 93eeee13309f95189845a5c28fb50fafd7695850 Mon Sep 17 00:00:00 2001 From: Jay Date: Fri, 8 Jan 2016 14:15:42 +0100 Subject: [PATCH] shutil can't remove files --- hooks/post_gen_project.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 03f97885f..5800d1c61 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -103,8 +103,16 @@ def remove_task_app(project_directory): def remove_channels_files(project_directory): """Removes channels files if it isn't going to be used""" - for path in ["config/routing.py", '{{ cookiecutter.repo_name }}/channelsapp']: - shutil.rmtree(path) + routing_file = os.path.join( + PROJECT_DIRECTORY, + "config/routing.py" + ) + os.remove(routing_file) + channels_app_location = os.path.join( + PROJECT_DIRECTORY, + '{{ cookiecutter.repo_name }}/channelsapp' + ) + shutil.rmtree(channels_app_location) # IN PROGRESS # def copy_doc_files(project_directory):