Skip to content

Commit

Permalink
CLOUD-2295: allow certificates step to succeed without npm (#70)
Browse files Browse the repository at this point in the history
I ran into this error while testing ih-setup locally:
```
/Users/myuser/homebrew-ih-public/lib/core/certificates/step.sh: line 96: npm: command not found
```

It's assuming everyone has `npm` installed globally, but that's not the
case for a lot of fresh installs.

This PR adds logic to allow the certificates step to succeed if you
don't have `npm` installed.

---------

Co-authored-by: Paul Brown <[email protected]>
  • Loading branch information
pb-dod and pb-dod authored Oct 6, 2023
1 parent 0e319d4 commit 88d7db4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.35
0.1.36
2 changes: 1 addition & 1 deletion formula/ih-core.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class IhCore < Formula
VERSION="0.1.35"
VERSION="0.1.36"
desc "Brew formula for installing core tools used at Included Health engineering."
homepage "https://github.com/ConsultingMD/homebrew-ih-public"
license "CC BY-NC-ND 4.0"
Expand Down
6 changes: 4 additions & 2 deletions lib/core/certificates/step.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@ function ih::setup::core.certificates::install() {
# with no obvious pattern.
curl https://www.amazontrust.com/repository/SFSRootCAG2.pem >>"$MOZILLA_PATH"

# Configure NPM to use the bundle.
npm config set cafile "$MOZILLA_PATH"
# Configure NPM to use the bundle, if npm exists.
if command -v npm &>/dev/null; then
npm config set cafile "$MOZILLA_PATH"
fi

if command -v yarn &>/dev/null; then
# Configure yarn to use the bundle.
Expand Down

0 comments on commit 88d7db4

Please sign in to comment.