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

fix: fixed args to sync-states

This commit is contained in:
Aradhya 2022-05-09 22:53:20 +05:30
parent 7f374887f4
commit c667be9023
2 changed files with 13 additions and 2 deletions

View File

@ -241,7 +241,9 @@ class App(AppMeta):
def update_app_state(self):
from bench.bench import Bench
bench = Bench(self.bench.name)
bench.apps.sync(self.name, self.tag, self.local_resolution)
bench.apps.sync(app_dir=self.app_name, app_name=self.name,
branch=self.tag, required_list=self.local_resolution)
def make_resolution_plan(app: App, bench: "Bench"):

View File

@ -170,7 +170,13 @@ class BenchApps(MutableSequence):
except FileNotFoundError:
self.states = {}
def update_apps_states(self, app_dir, app_name: Union[str, None] = None, branch: Union[str, None] = None, required:List = []):
def update_apps_states(
self,
app_dir: str = None,
app_name: Union[str, None] = None,
branch: Union[str, None] = None,
required: List = [],
):
if self.apps and not os.path.exists(self.states_path):
# idx according to apps listed in apps.txt (backwards compatibility)
# Keeping frappe as the first app.
@ -200,6 +206,9 @@ class BenchApps(MutableSequence):
for app in apps_to_remove:
del self.states[app]
if app_name and not app_dir:
app_dir = app_name
if app_name and app_name not in self.states:
version = get_current_version(app_name, self.bench.name)