Skip to content

Commit 84b230d

Browse files
committed
Merge branch 'staging' into v5.x
2 parents 6829f14 + ba90700 commit 84b230d

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

bench/app.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ def prune_app_directory(self):
423423
remove_unused_node_modules(app_path)
424424

425425

426-
def coerce_url_to_name_if_possible(git_url: str, cache_key:str) -> str:
426+
def coerce_url_to_name_if_possible(git_url: str, cache_key: str) -> str:
427427
app_name = os.path.basename(git_url)
428428
if can_get_cached(app_name, cache_key):
429429
return app_name
@@ -435,7 +435,7 @@ def can_get_cached(app_name: str, cache_key: str) -> bool:
435435
Used before App is initialized if passed `git_url` is a
436436
file URL as opposed to the app name.
437437
438-
If True then `git_url` can be coerced into the `app_name` and
438+
If True then `git_url` can be coerced into the `app_name` and
439439
checking local remote and fetching can be skipped while keeping
440440
get-app command params the same.
441441
"""
@@ -671,7 +671,7 @@ def get_app(
671671
import bench.cli as bench_cli
672672
from bench.bench import Bench
673673
from bench.utils.app import check_existing_dir
674-
674+
675675
if urlparse(git_url).scheme == "file" and cache_key:
676676
git_url = coerce_url_to_name_if_possible(git_url, cache_key)
677677

@@ -908,7 +908,9 @@ def install_app(
908908
install_python_dev_dependencies(apps=app, bench_path=bench_path, verbose=verbose)
909909

910910
if not using_cached and os.path.exists(os.path.join(app_path, "package.json")):
911-
yarn_install = "yarn install --verbose" if verbose else "yarn install"
911+
yarn_install = "yarn install --check-files"
912+
if verbose:
913+
yarn_install += " --verbose"
912914
bench.run(yarn_install, cwd=app_path)
913915

914916
bench.apps.sync(app_name=app, required=resolution, branch=tag, app_dir=app_path)

bench/utils/bench.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,14 @@
1818
# imports - module imports
1919
import bench
2020
from bench.exceptions import PatchError, ValidationError
21-
from bench.utils import (exec_cmd, get_bench_cache_path, get_bench_name,
22-
get_cmd_output, log, which)
21+
from bench.utils import (
22+
exec_cmd,
23+
get_bench_cache_path,
24+
get_bench_name,
25+
get_cmd_output,
26+
log,
27+
which,
28+
)
2329

2430
logger = logging.getLogger(bench.PROJECT_NAME)
2531

@@ -132,7 +138,9 @@ def update_yarn_packages(bench_path=".", apps=None, verbose=None):
132138
app_path = os.path.join(apps_dir, app)
133139
if os.path.exists(os.path.join(app_path, "package.json")):
134140
click.secho(f"\nInstalling node dependencies for {app}", fg="yellow")
135-
yarn_install = "yarn install --verbose" if verbose else "yarn install"
141+
yarn_install = "yarn install --check-files"
142+
if verbose:
143+
yarn_install += " --verbose"
136144
bench.run(yarn_install, cwd=app_path)
137145

138146

@@ -329,7 +337,10 @@ def restart_supervisor_processes(bench_path=".", web_workers=False, _raise=False
329337
for group in groups:
330338
failure = bench.run(f"{sudo}supervisorctl restart {group}", _raise=_raise)
331339
if failure:
332-
log(f"restarting supervisor group `{group}` failed. Use `bench restart` to retry.", level=3)
340+
log(
341+
f"restarting supervisor group `{group}` failed. Use `bench restart` to retry.",
342+
level=3,
343+
)
333344

334345

335346
def restart_systemd_processes(bench_path=".", web_workers=False, _raise=True):

0 commit comments

Comments
 (0)