1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-10-30 21:03:12 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

create package with hash

This commit is contained in:
tdzl2003
2016-02-23 18:49:53 +08:00
parent 8b887383c6
commit 9ecd7133c5
4 changed files with 84 additions and 49 deletions

View File

@@ -15,6 +15,21 @@ export function question(query, password) {
}, (err, result)=> err ? reject(err) : resolve(result)));
}
export function translateOptions(options){
const ret = {};
for (let key in options) {
const v = options[key];
if (typeof(v) === 'string') {
ret[key] = v.replace(/\$\{(\w+)\}/g, function (v, n){
return options[n] || process.env[n] || v;
})
} else {
ret[key] = v;
}
}
return ret;
}
export function getRNVersion() {
const version = JSON.parse(fs.readFileSync(path.resolve('node_modules/react-native/package.json'))).version;