Skip to content

In the setup script, install yarn with npm #6696

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion support-frontend/Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ tap "guardian/devtools"
brew "guardian/devtools/dev-nginx"
cask "gu-scala"
brew "awscli"
brew "yarn"
9 changes: 4 additions & 5 deletions support-frontend/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,9 @@ setup_nginx() {
dev-nginx restart-nginx
}

install_yarn_if_linux() {
# This will be installed by 'install_brew_deps' if on mac
if linux && ! installed yarn; then
sudo apt-get install yarn
install_yarn() {
if ! installed yarn; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this recognise if yarn is installed with Homebrew?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think so. The installed function uses the hash utility, and I can see that it can understands utilities installed with homebrew. For example in bash:

bash-3.2$ which dev-nginx
/opt/homebrew/bin/dev-nginx
bash-3.2$ hash dev-nginx # no output == found it
bash-3.2$ hash dev-nginxssss
bash: hash: dev-nginxssss: not found

npm install -g yarn
fi
}

Expand All @@ -139,11 +138,11 @@ main () {
check_encryption
create_aws_config
install_node
install_yarn
install_homebrew_if_mac
install_brew_deps
setup_nginx
install_jdk
install_yarn_if_linux
install_js_deps

report
Expand Down
Loading