mirror of
https://github.com/frappe/bench.git
synced 2025-01-09 08:30:39 +00:00
fix: bench.utils.get_sites updated to frappe.utils.get_sites
avoids issues with non sites folder like 'jupyter_notebooks'
This commit is contained in:
parent
073f6d00a4
commit
a3dc9e69b7
@ -208,10 +208,15 @@ def build_assets(bench_path='.', app=None):
|
|||||||
exec_cmd(command, cwd=bench_path)
|
exec_cmd(command, cwd=bench_path)
|
||||||
|
|
||||||
def get_sites(bench_path='.'):
|
def get_sites(bench_path='.'):
|
||||||
sites_dir = os.path.join(bench_path, "sites")
|
sites_path = os.path.join(bench_path, 'sites')
|
||||||
sites = [site for site in os.listdir(sites_dir)
|
sites = []
|
||||||
if os.path.isdir(os.path.join(sites_dir, site)) and site not in ('assets',)]
|
for site in os.listdir(sites_path):
|
||||||
return sites
|
path = os.path.join(sites_path, site)
|
||||||
|
if (os.path.isdir(path)
|
||||||
|
and not os.path.islink(path)
|
||||||
|
and os.path.exists(os.path.join(path, 'site_config.json'))):
|
||||||
|
sites.append(site)
|
||||||
|
return sorted(sites)
|
||||||
|
|
||||||
def get_sites_dir(bench_path='.'):
|
def get_sites_dir(bench_path='.'):
|
||||||
return os.path.abspath(os.path.join(bench_path, 'sites'))
|
return os.path.abspath(os.path.join(bench_path, 'sites'))
|
||||||
|
Loading…
Reference in New Issue
Block a user