2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-12 08:16:28 +00:00

feat: Made dynamic mount path if bench attr is passed to App class

This commit is contained in:
Aradhya 2022-05-05 19:57:37 +05:30
parent 49900ce74b
commit b36c0723be
2 changed files with 4 additions and 6 deletions

View File

@ -73,11 +73,10 @@ class AppMeta:
def setup_details(self):
# fetch meta from installed apps
if (
not self.to_clone
and hasattr(self, "bench")
and os.path.exists(self.mount_path)
if hasattr(self, "bench") and os.path.exists(
os.path.join(self.bench.name, "apps", self.name)
):
self.mount_path = os.path.join(self.bench.name, "apps", self.name)
self.from_apps = True
self._setup_details_from_mounted_disk()

View File

@ -123,8 +123,7 @@ class Bench(Base, Validator):
from bench.app import App
self.validate_app_uninstall(app)
path_to_app = os.path.join(self.name, "apps", app)
self.apps.remove(App(path_to_app, bench=self, to_clone=False))
self.apps.remove(App(app, bench=self, to_clone=False))
self.apps.sync()
# self.build() - removed because it seems unnecessary
self.reload()