Skip to content

Commit

Permalink
fix: read apps name from instead of apps directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdeali099 committed Apr 30, 2024
1 parent 5a0922d commit 9915cf8
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions bench/bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 9915cf8

Please sign in to comment.