From c47590ae04b8a64a99791655dfbf6ca7ee12fd8f Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 18 Jan 2016 10:42:06 +0530 Subject: [PATCH] [docs] delete user folder before writing new files (so old files will be deleted) --- frappe/utils/setup_docs.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frappe/utils/setup_docs.py b/frappe/utils/setup_docs.py index 85f3d9a19d..9001ed835e 100644 --- a/frappe/utils/setup_docs.py +++ b/frappe/utils/setup_docs.py @@ -116,8 +116,10 @@ class setup_docs(object): # make /user user_path = os.path.join(self.docs_path, "user") - if not os.path.exists(user_path): - os.makedirs(user_path) + if os.path.exists(user_path): + shutil.rmtree(user_path, ignore_errors=True) + + os.makedirs(user_path) # make /assets/img img_path = os.path.join(self.docs_path, "assets", "img")