diff --git a/lib/detect/darwin.js b/lib/detect/darwin.js index 2e15b37..924f947 100644 --- a/lib/detect/darwin.js +++ b/lib/detect/darwin.js @@ -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, '..', '..', '..') @@ -21,6 +18,9 @@ function finder (bundleId, versionKey) { callback(null, execPath, info[versionKey]) }) + }).catch(function (err) { + // Ignore not found error + callback() }) } } diff --git a/package.json b/package.json index 278b096..1e99a51 100644 --- a/package.json +++ b/package.json @@ -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",