Skip to content

Commit

Permalink
fix: bench.utils.get_sites updated to frappe.utils.get_sites
Browse files Browse the repository at this point in the history
avoids issues with non sites folder like 'jupyter_notebooks'
  • Loading branch information
developmentforpeople authored and gavindsouza committed Jan 2, 2020
1 parent 073f6d0 commit a3dc9e6
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions bench/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,15 @@ def build_assets(bench_path='.', app=None):
exec_cmd(command, cwd=bench_path)

def get_sites(bench_path='.'):
sites_dir = os.path.join(bench_path, "sites")
sites = [site for site in os.listdir(sites_dir)
if os.path.isdir(os.path.join(sites_dir, site)) and site not in ('assets',)]
return sites
sites_path = os.path.join(bench_path, 'sites')
sites = []
for site in os.listdir(sites_path):
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='.'):
return os.path.abspath(os.path.join(bench_path, 'sites'))
Expand Down

0 comments on commit a3dc9e6

Please sign in to comment.