Skip to content

Commit

Permalink
Set up darwin detectors in index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Mitchell Hentges committed Feb 29, 2016
1 parent d71fa27 commit 5209a62
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 36 deletions.
6 changes: 0 additions & 6 deletions lib/darwin/canary.js

This file was deleted.

6 changes: 0 additions & 6 deletions lib/darwin/chrome.js

This file was deleted.

6 changes: 0 additions & 6 deletions lib/darwin/chromium.js

This file was deleted.

19 changes: 14 additions & 5 deletions lib/darwin/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
exports.safari = require( './safari' );
var util = require('./util');

function browser(id, versionKey) {
return {
path: util.find.bind(null, id),
version: util.getInfoKey(null, id, versionKey)
};
}

exports.safari = browser('com.apple.Safari', 'CFBundleShortVersionString');
exports.firefox = require( './firefox' );
exports.chrome = exports[ 'google-chrome' ] = require( './chrome' );
exports.chromium = require( './chromium' );
exports.canary = exports[ 'chrome-canary' ] = exports[ 'google-chrome-canary' ] = require( './canary' );
exports.opera = require( './opera' );
exports.chrome = exports[ 'google-chrome' ] = browser('com.google.Chrome', 'KSVersion');
exports.chromium = browser('org.chromium.Chromium', 'CFBundleShortVersionString');
exports.canary = exports[ 'chrome-canary' ] = exports[ 'google-chrome-canary' ] = browser('com.google.Chrome.canary', 'KSVersion');
exports.opera = browser('com.operasoftware.Opera', 'CFBundleVersion');
6 changes: 0 additions & 6 deletions lib/darwin/opera.js

This file was deleted.

6 changes: 0 additions & 6 deletions lib/darwin/safari.js

This file was deleted.

2 changes: 1 addition & 1 deletion lib/darwin/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ function getInfoKey(bundleId, key, callback) {
callback(null, data[key]);
});
});
}
}

0 comments on commit 5209a62

Please sign in to comment.