Skip to content

Commit

Permalink
fix: fixed args to sync-states
Browse files Browse the repository at this point in the history
  • Loading branch information
Aradhya-Tripathi committed May 9, 2022
1 parent 7f37488 commit c667be9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 3 additions & 1 deletion bench/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ def _get_dependencies(self):
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"):
Expand Down
11 changes: 10 additions & 1 deletion bench/bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,13 @@ def set_states(self):
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.
Expand Down Expand Up @@ -200,6 +206,9 @@ def update_apps_states(self, app_dir, app_name: Union[str, None] = None, branch
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)

Expand Down

0 comments on commit c667be9

Please sign in to comment.