mirror of
https://github.com/frappe/bench.git
synced 2025-01-10 17:24:41 +00:00
fix: support for local and remote apps when looking for dependencies
This commit is contained in:
parent
61a864de11
commit
2f17da1bf0
@ -220,7 +220,7 @@ class App(AppMeta):
|
|||||||
if self.on_disk:
|
if self.on_disk:
|
||||||
required_deps = os.path.join(self.mount_path, self.repo,'hooks.py')
|
required_deps = os.path.join(self.mount_path, self.repo,'hooks.py')
|
||||||
try:
|
try:
|
||||||
print(required_apps_from_hooks(required_deps))
|
print(required_apps_from_hooks(required_deps, local=True))
|
||||||
except IndexError:
|
except IndexError:
|
||||||
print(f"No dependencies for {self.repo}")
|
print(f"No dependencies for {self.repo}")
|
||||||
finally:
|
finally:
|
||||||
@ -231,8 +231,6 @@ class App(AppMeta):
|
|||||||
except Exception:
|
except Exception:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
return required_apps
|
|
||||||
|
|
||||||
def update_app_state(self):
|
def update_app_state(self):
|
||||||
from bench.bench import Bench
|
from bench.bench import Bench
|
||||||
bench = Bench(self.bench.name)
|
bench = Bench(self.bench.name)
|
||||||
|
@ -183,7 +183,8 @@ def get_required_deps(org, name, branch, deps="hooks.py"):
|
|||||||
return base64.decodebytes(res["content"].encode()).decode()
|
return base64.decodebytes(res["content"].encode()).decode()
|
||||||
|
|
||||||
|
|
||||||
def required_apps_from_hooks(required_deps):
|
def required_apps_from_hooks(required_deps, local=False):
|
||||||
|
if local:
|
||||||
with open(required_deps) as f:
|
with open(required_deps) as f:
|
||||||
required_deps = f.read()
|
required_deps = f.read()
|
||||||
lines = [x for x in required_deps.split("\n") if x.strip().startswith("required_apps")]
|
lines = [x for x in required_deps.split("\n") if x.strip().startswith("required_apps")]
|
||||||
|
Loading…
Reference in New Issue
Block a user