Skip to content

Commit

Permalink
fix: Correctly detect local binary when installing via npm
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilogorek committed Jul 26, 2023
1 parent 23cdcec commit d26f7cd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,12 @@

"You know what they say. Fool me once, strike one, but fool me twice... strike three." — Michael Scott

## 2.20.1

### Various fixes and improvements

- fix: Correctly detect local binary when installing via npm (#1695)

## 2.20.0

### Various fixes and improvements
Expand Down
4 changes: 3 additions & 1 deletion scripts/install.js
Expand Up @@ -193,7 +193,9 @@ async function downloadBinary() {

if (process.env.SENTRYCLI_USE_LOCAL === '1') {
try {
const binPath = which.sync('sentry-cli');
const binPaths = which.sync('sentry-cli', { all: true });
if (!binPaths.length) throw new Error('Binary not found');
const binPath = binPaths[binPaths.length - 1];
logger.log(`Using local binary: ${binPath}`);
fs.copyFileSync(binPath, outputPath);
return Promise.resolve();
Expand Down

0 comments on commit d26f7cd

Please sign in to comment.