mobileprovision-parse
Advanced tools
Comparing version 0.0.5 to 0.1.0
30
index.js
var htmlDecode = require('htmlEncode').htmlDecode | ||
var exec = require('child_process').exec | ||
var child_process = require('child_process') | ||
function exec(cmd, opt) { | ||
opt = Object.assign({ | ||
cwd: __dirname | ||
}, opt) | ||
return new Promise((resolve, reject) => { | ||
child_process.exec(cmd, opt, (err, stdout, stderr) => { | ||
if(err) { | ||
reject(stderr) | ||
} else { | ||
resolve(stdout) | ||
} | ||
}) | ||
}) | ||
} | ||
function getVal(xml, name) { | ||
@@ -45,13 +60,12 @@ var m = new RegExp(`<key>${name}<\\/key>\\n\\s*<string>(.+)<\\/string>`) | ||
var cmd = `security cms -D -i ${profilePath}` | ||
exec(cmd, (err, stdout, stderr) => { | ||
if(!err) { | ||
return exec(cmd) | ||
.then(stdout => { | ||
var info = getInfo(stdout) | ||
if(typeof cb === 'function') { | ||
cb(getInfo(stdout)) | ||
cb(info) | ||
} | ||
} else { | ||
throw new Error(stderr) | ||
} | ||
}) | ||
return Promise.resolve(info) | ||
}) | ||
} | ||
module.exports = main |
{ | ||
"name": "mobileprovision-parse", | ||
"version": "0.0.5", | ||
"version": "0.1.0", | ||
"description": "mobileprovision-parse", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -9,5 +9,6 @@ # mobileprovision-parse | ||
var parse = require('mobileprovision-parse') | ||
parse('xxx.mobileprovision', info => { | ||
console.log(info) | ||
}) | ||
parse('xxx.mobileprovision') | ||
.then(info => { | ||
console.log(info) | ||
}) | ||
``` |
var parse = require('../index') | ||
parse('/Users/guoshengqiang/Documents/项目资源/uileader/iOS/dev.mobileprovision', info => { | ||
console.log(info) | ||
}) | ||
parse('/Users/guoshengqiang/Documents/项目资源/uileader/iOS/dev.mobileprovision') | ||
.then(info => { | ||
console.log('mobileprovision info: ', info) | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
2625
67
13
1