diff --git a/bench/bench.py b/bench/bench.py index 0b0c7af77..01a611d86 100644 --- a/bench/bench.py +++ b/bench/bench.py @@ -62,13 +62,13 @@ def __init__(self, path): self.cwd = os.path.abspath(path) self.exists = is_bench_directory(self.name) + self.apps_txt = os.path.join(self.name, "sites", "apps.txt") + self.excluded_apps_txt = os.path.join(self.name, "sites", "excluded_apps.txt") + self.setup = BenchSetup(self) self.teardown = BenchTearDown(self) self.apps = BenchApps(self) - self.apps_txt = os.path.join(self.name, "sites", "apps.txt") - self.excluded_apps_txt = os.path.join(self.name, "sites", "excluded_apps.txt") - @property def python(self) -> str: return get_env_cmd("python", bench_path=self.name) @@ -274,11 +274,14 @@ def sync( def initialize_apps(self): try: - self.apps = [ - x - for x in os.listdir(os.path.join(self.bench.name, "apps")) - if is_frappe_app(os.path.join(self.bench.name, "apps", x)) - ] + with open(self.bench.apps_txt) as f: + self.apps = [ + app.strip() + for app in f.read().split("\n") + if len(app) > 0 and is_frappe_app(os.path.join(self.bench.name, "apps", app)) + ] + + # FIXME: can be remove self.apps.remove("frappe") self.apps.insert(0, "frappe") except FileNotFoundError: