diff --git a/.travis.yml b/.travis.yml index f3fa8cd..f98fed0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ language: node_js node_js: + - '12' - '10' - '8' diff --git a/index.js b/index.js index ff82c09..d791638 100644 --- a/index.js +++ b/index.js @@ -73,7 +73,10 @@ module.exports = async (target, options) => { if (options.app) { command = options.app; } else { - const useSystemXdgOpen = process.versions.electron || process.platform === 'android'; + // When bundled by Webpack, there's no actual package file path and no local `xdg-open`. + const isBundled = !__dirname || __dirname === '/'; + + const useSystemXdgOpen = process.versions.electron || process.platform === 'android' || isBundled; command = useSystemXdgOpen ? 'xdg-open' : path.join(__dirname, 'xdg-open'); } diff --git a/package.json b/package.json index 6bb5042..8f6fdbe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "open", - "version": "6.2.0", + "version": "6.3.0", "description": "Open stuff like URLs, files, executables. Cross-platform.", "license": "MIT", "repository": "sindresorhus/open",