From bf19ebdeb6cdaaef4d01e431d15bc9da139d1392 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Thu, 27 Jan 2022 19:17:41 +0530 Subject: [PATCH] fix(boilerplate): add .gitkeep in public folder (#15765) add .gitkeep file so that public folder is committed to git this is needed because if public doesn't exist, bench build doesn't symlink the public folder to sites/assets --- frappe/utils/boilerplate.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frappe/utils/boilerplate.py b/frappe/utils/boilerplate.py index 6fa2aee0d4..634c99de13 100755 --- a/frappe/utils/boilerplate.py +++ b/frappe/utils/boilerplate.py @@ -62,6 +62,11 @@ def make_boilerplate(dest, app_name, no_git=False): frappe.create_folder(os.path.join(dest, hooks.app_name, hooks.app_name, "public", "js")) + # add .gitkeep file so that public folder is committed to git + # this is needed because if public doesn't exist, bench build doesn't symlink the apps assets + with open(os.path.join(dest, hooks.app_name, hooks.app_name, "public", ".gitkeep"), "w") as f: + f.write('') + with open(os.path.join(dest, hooks.app_name, hooks.app_name, "__init__.py"), "w") as f: f.write(frappe.as_unicode(init_template))