2
0
mirror of https://github.com/frappe/bench.git synced 2024-09-24 21:19:00 +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): def setup_details(self):
# fetch meta from installed apps # fetch meta from installed apps
if ( if hasattr(self, "bench") and os.path.exists(
not self.to_clone os.path.join(self.bench.name, "apps", self.name)
and hasattr(self, "bench")
and os.path.exists(self.mount_path)
): ):
self.mount_path = os.path.join(self.bench.name, "apps", self.name)
self.from_apps = True self.from_apps = True
self._setup_details_from_mounted_disk() self._setup_details_from_mounted_disk()

View File

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