From 411075424eef9794e2ea98ee1a4c1e0a215f7148 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Thu, 6 May 2021 19:31:15 +0530 Subject: [PATCH] refactor(minor): Simplify site directory generation --- frappe/installer.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/frappe/installer.py b/frappe/installer.py index e3fd66228d..d7d885d60e 100755 --- a/frappe/installer.py +++ b/frappe/installer.py @@ -390,18 +390,16 @@ def get_conf_params(db_name=None, db_password=None): def make_site_dirs(): - site_public_path = os.path.join(frappe.local.site_path, 'public') - site_private_path = os.path.join(frappe.local.site_path, 'private') - for dir_path in ( - os.path.join(site_private_path, 'backups'), - os.path.join(site_public_path, 'files'), - os.path.join(site_private_path, 'files'), - os.path.join(frappe.local.site_path, 'logs'), - if not os.path.exists(dir_path): - os.makedirs(dir_path) - locks_dir = frappe.get_site_path('locks') - if not os.path.exists(locks_dir): - os.makedirs(locks_dir) + for dir_path in [ + os.path.join("public", "files"), + os.path.join("private", "backups"), + os.path.join("private", "files"), + "error-snapshots", + "locks", + "logs", + ]: + path = frappe.get_site_path(dir_path) + os.makedirs(path, exist_ok=True) def add_module_defs(app):