This commit is contained in:
Tiệp Sunflower
2023-03-06 14:23:39 +07:00
commit aa9c76c82f
2234 changed files with 449471 additions and 0 deletions

26
node_modules/chrome/common.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
var fs = require('fs')
var exec = require('child_process').exec
var path = require('path')
var plist = require('plist')
exports.find = function(id, cb) {
var pathQuery = 'mdfind "kMDItemCFBundleIdentifier=="' + id + '""'
exec(pathQuery, function (err, stdout) {
var loc = stdout.trim()
if (loc === '') {
loc = null
err = err || new Error('Not found.')
}
cb(err, loc)
})
}
exports.parseVersionByPlist = function(plPath, key, cb) {
if (!fs.existsSync(plPath)) {
cb(null)
} else {
var data = plist.parse(fs.readFileSync(plPath, 'utf8'))
cb(data[key])
}
}