diff --git a/CHANGELOG.md b/CHANGELOG.md index e94e1f6..9cb95df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * Add documentation cookbook for using pg_activity * Forward CI env vars in Docker containers +* Run the npm/yarn/webpack commands on the host for all mac users (even the ones not using Dinghy) ## 3.7.0 (2022-05-24) diff --git a/tasks.py b/tasks.py index ea46bcd..fd06904 100644 --- a/tasks.py +++ b/tasks.py @@ -4,6 +4,7 @@ from distutils.spawn import find_executable import json import os +import platform import re import requests import subprocess @@ -68,9 +69,9 @@ def install(c): if os.path.isfile(c.root_dir + '/' + c.project_directory + '/composer.json'): docker_compose_run(c, 'composer install -n --prefer-dist --optimize-autoloader', no_deps=True) if os.path.isfile(c.root_dir + '/' + c.project_directory + '/yarn.lock'): - run_in_docker_or_locally_for_dinghy(c, 'yarn', no_deps=True) + run_in_docker_or_locally_for_mac(c, 'yarn', no_deps=True) elif os.path.isfile(c.root_dir + '/' + c.project_directory + '/package.json'): - run_in_docker_or_locally_for_dinghy(c, 'npm install', no_deps=True) + run_in_docker_or_locally_for_mac(c, 'npm install', no_deps=True) @task @@ -244,11 +245,11 @@ def generate_certificates(c, force=False): print('Please restart the infrastructure to use the new certificates with "inv up" or "inv start".') -def run_in_docker_or_locally_for_dinghy(c, command, no_deps=False): +def run_in_docker_or_locally_for_mac(c, command, no_deps=False): """ Mac users have a lot of problems running Yarn / Webpack on the Docker stack so this func allow them to run these tools on their host """ - if c.dinghy: + if c.dinghy or 'Darwin' == platform.system(): with c.cd(c.project_directory): c.run(command) else: