Skip to content

Commit

Permalink
add special case for Homebrew; add Node.js 12 to build matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
boneskull committed Apr 26, 2019
1 parent cb13b72 commit 0e998bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
language: node_js
node_js:
- '12'
- '10'
- '8'
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ const defaultNpmPrefix = (() => {
return path.dirname(process.execPath);
}

// Homebrew special case; always assume /usr/local
if (process.execPath.startsWith('/usr/local/Cellar/node')) {
return '/usr/local';
}

// `/usr/local/bin/node` → `prefix=/usr/local`
return path.dirname(path.dirname(process.execPath));
})();
Expand Down

0 comments on commit 0e998bb

Please sign in to comment.