Skip to content

Commit

Permalink
chromium should use util
Browse files Browse the repository at this point in the history
  • Loading branch information
Mitchell Hentges committed Feb 29, 2016
1 parent 8cc2a9b commit d71fa27
Showing 1 changed file with 4 additions and 30 deletions.
34 changes: 4 additions & 30 deletions lib/darwin/chromium.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,6 @@
var util = require('./util'),
currentPath;
CHROMIUM_ID = 'org.chromium.Chromium',
CHROMIUM_VERSION = 'CFBundleShortVersionString';

function getPath(callback) {
if (currentPath) {
return callback(null, currentPath);
}

util.find('org.chromium.Chromium', function (err, path) {
currentPath = path;
callback(err, currentPath);
});
}

function getVersion(callback) {
getPath(function (err, path) {
if (err) {
return callback(err, null);
}

util.parse(util.getInfoPath(path), function (err, data) {
if (err) {
return callback(err, null);
}

callback(null, data['CFBundleShortVersionString']);
});
});
}

exports.path = getPath;
exports.version = getVersion;
exports.path = util.find.bind(null, CHROMIUM_ID);
exports.version = util.getInfoKey.bind(null, CHROMIUM_ID, CHROMIUM_VERSION);

0 comments on commit d71fa27

Please sign in to comment.