Skip to content

Commit

Permalink
🐛 Fix wrong binary with multiple options (#920)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmigual authored Apr 3, 2023
1 parent e444eda commit 3233414
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1048,9 +1048,11 @@ export async function isBinInPath(
result.toString() === "" ||
result.toString().indexOf("Could not find files") < 0
) {
return binaryName.localeCompare(result.toString().trim()) === 0
// Sometimes multiple paths can be returned. They are separated by new lines, get only the first one
const selectedResult = result.toString().split("\n")[0].trim();
return binaryName.localeCompare(selectedResult) === 0
? ""
: result.toString().trim();
: selectedResult;
}
} catch (error) {
Logger.error(`Cannot access filePath: ${binaryName}`, error);
Expand Down

0 comments on commit 3233414

Please sign in to comment.