2
0
mirror of https://github.com/frappe/bench.git synced 2024-09-24 21:19:00 +00:00

fix: Fixed order of install

This commit is contained in:
Aradhya 2022-04-04 23:42:52 +05:30
parent a1a35eed0e
commit 281d96ac16

View File

@ -173,6 +173,13 @@ class BenchApps(MutableSequence):
def update_apps_states(self, app_name: Union[str, None] = None, branch: Union[str, None] = None, required:List = []): def update_apps_states(self, app_name: Union[str, None] = None, branch: Union[str, None] = None, required:List = []):
if self.apps and not os.path.exists(self.states_path): if self.apps and not os.path.exists(self.states_path):
# idx according to apps listed in apps.txt (backwards compatibility) # idx according to apps listed in apps.txt (backwards compatibility)
# Keeping frappe as the first app.
if "frappe" in self.apps:
self.apps.remove("frappe")
self.apps.insert(0, "frappe")
with open(self.bench.apps_txt, "w") as f:
f.write("\n".join(self.apps))
print("Found existing apps updating states...") print("Found existing apps updating states...")
for idx, app in enumerate(self.apps, start=1): for idx, app in enumerate(self.apps, start=1):
self.states[app] = { self.states[app] = {
@ -184,8 +191,6 @@ class BenchApps(MutableSequence):
"idx": idx, "idx": idx,
"version": get_current_version(app, self.bench.name), "version": get_current_version(app, self.bench.name),
} }
with open(self.states_path, "w") as f:
f.write(json.dumps(self.states, indent=4))
apps_to_remove = [] apps_to_remove = []
for app in self.states: for app in self.states:
@ -195,7 +200,7 @@ class BenchApps(MutableSequence):
for app in apps_to_remove: for app in apps_to_remove:
del self.states[app] del self.states[app]
if app_name: if app_name and app_name not in self.states:
version = get_current_version(app_name, self.bench.name) version = get_current_version(app_name, self.bench.name)
app_dir = os.path.join(self.apps_path, app_name) app_dir = os.path.join(self.apps_path, app_name)