From b77434bb616e2f02787dc2370c89f26774d7053b Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Mon, 19 Feb 2018 20:25:35 +0530 Subject: [PATCH] Install yarn if not found --- bench/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bench/utils.py b/bench/utils.py index 37f27853..25e58925 100755 --- a/bench/utils.py +++ b/bench/utils.py @@ -434,7 +434,10 @@ def update_npm_packages(bench_path='.'): for app in os.listdir(apps_dir): app_path = os.path.join(apps_dir, app) if os.path.exists(os.path.join(app_path, 'package.json')): - exec_cmd('./node_modules/.bin/yarn install', cwd=app_path) + yarn_executable = './node_modules/.bin/yarn' + if not os.path.exists(os.path.join(app_path, yarn_executable)): + exec_cmd('npm install yarn', cwd=app_path) + exec_cmd('{yarn} install'.format(yarn=yarn_executable), cwd=app_path) def install_requirements(pip, req_file):