Skip to content

Commit

Permalink
Clean up boolean logic for enabling Edge
Browse files Browse the repository at this point in the history
  • Loading branch information
nickserv committed Nov 1, 2016
1 parent 1e249c1 commit d1b631a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,11 @@ var DetectBrowsers = function (config, logger) {
try {
var browserLocated = fs.existsSync(browserPaths[y]) || process.env[browser.ENV_CMD] || which.sync(browserPaths[y]);

// ignore Edge on operating systems other than Windows 10
// don't use Edge on operating systems other than Windows 10
// (the launcher would be found, but would fail to run)
var browserIgnored = browser.name === 'Edge' &&
(!process.platform === 'win32' || !/^1\d/.test(os.release()));
var useBrowser = browser.name !== 'Edge' || process.platform === 'win32' && /^1\d/.test(os.release());

if (browserLocated && !browserIgnored) {
if (browserLocated && useBrowser) {
// add browser when found in file system or when env variable is set
result.push(browser.name);

Expand Down

0 comments on commit d1b631a

Please sign in to comment.