Skip to content

Commit

Permalink
Upgrade to @httptoolkit/osx-find-executable 2.x
Browse files Browse the repository at this point in the history
The previous version emits an npm-audit warning, for the change
at httptoolkit/osx-find-executable@20fb1e2c,
which is a breaking change that can't be patched downstream as it
is incompatible with the current way the function is called.
  • Loading branch information
Krinkle committed Apr 28, 2023
1 parent b67d2f5 commit f227d19
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions lib/detect/darwin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@

const path = require('path')
const plist = require('simple-plist')
const osxFindExecutable = require('@httptoolkit/osx-find-executable')
const { findOsxExecutable } = require('@httptoolkit/osx-find-executable')

function finder (bundleId, versionKey) {
return function find (callback) {
osxFindExecutable(bundleId, function (err, execPath) {
// Ignore not found error
if (err) return callback()

findOsxExecutable(bundleId).then(function (execPath) {
// The execPath is always "${bundlePath}/Contents/MacOS/${name}",
// e.g. "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
const bundlePath = path.resolve(execPath, '..', '..', '..')
Expand All @@ -21,6 +18,9 @@ function finder (bundleId, versionKey) {

callback(null, execPath, info[versionKey])
})
}).catch(function (err) {
// Ignore not found error
callback()
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"index.js"
],
"dependencies": {
"@httptoolkit/osx-find-executable": "^1.1.0",
"@httptoolkit/osx-find-executable": "^2.1.0",
"debug": "^4.2.0",
"headless-support": "^1.0.0",
"simple-plist": "^1.1.1",
Expand Down

0 comments on commit f227d19

Please sign in to comment.