actbase-cli
Advanced tools
Comparing version 0.0.20 to 0.0.21
@@ -257,2 +257,3 @@ "use strict"; | ||
const file = yield (0, _utils.getPackageJson)(); | ||
console.log('Waiting for AppCenter response...'); | ||
const cmd = `appcenter apps list`; | ||
@@ -263,5 +264,40 @@ | ||
console.log(stdout.split('\n').filter(v => v).map(v => (0, _lodash.trim)(v))); | ||
process.exit(0); | ||
const orgs = []; | ||
const keys = stdout.split('\n').filter(v => v).map(v => { | ||
const str = (0, _lodash.trim)(v); | ||
const org = str.substr(0, str.indexOf('/')); | ||
if (orgs.indexOf(org) < 0) orgs.push(org); | ||
return str; | ||
}); | ||
const noKeyAnd = !(file === null || file === void 0 ? void 0 : file.appcenter_and) || keys.indexOf(file === null || file === void 0 ? void 0 : file.appcenter_and) < 0; | ||
const noKeyIos = !(file === null || file === void 0 ? void 0 : file.appcenter_ios) || keys.indexOf(file === null || file === void 0 ? void 0 : file.appcenter_ios) < 0; | ||
if (noKeyAnd || noKeyIos) { | ||
const orgData = yield (0, _utils.select)('Select the AppCenter Organization.', orgs); | ||
if (noKeyAnd) { | ||
const keyData = yield (0, _utils.select)('Select the AppCenter key for Android.', keys.filter(v => v.startsWith(orgData.value))); | ||
file.appcenter_and = keyData; | ||
} | ||
if (noKeyIos) { | ||
const keyData = yield (0, _utils.select)('Select the AppCenter key for iOS.', keys.filter(v => v.startsWith(orgData.value))); | ||
file.appcenter_ios = keyData; | ||
} // console.log(orgData.value); | ||
process.exit(0); | ||
} | ||
if (!(file === null || file === void 0 ? void 0 : file.appcenter_and) || keys.indexOf(file === null || file === void 0 ? void 0 : file.appcenter_and) < 0) { | ||
const keyData = yield (0, _utils.select)('Select the AppCenter key for Android.', keys); | ||
console.log(keyData); | ||
process.exit(0); | ||
} | ||
if (!(file === null || file === void 0 ? void 0 : file.appcenter_ios) || keys.indexOf(file === null || file === void 0 ? void 0 : file.appcenter_ios) < 0) { | ||
console.log('Not found iOS Key'); | ||
process.exit(0); | ||
} | ||
if (!(file === null || file === void 0 ? void 0 : (_file$actbase = file.actbase) === null || _file$actbase === void 0 ? void 0 : _file$actbase.codepush) || argv.reset) { | ||
@@ -268,0 +304,0 @@ file.actbase.codepush = yield install(file); |
@@ -21,2 +21,4 @@ "use strict"; | ||
const selectShell = require('select-shell'); | ||
const chalk = require('chalk'); | ||
@@ -124,4 +126,17 @@ | ||
try { | ||
const list = selectShell(); | ||
var stream = process.stdin; | ||
list.option(' One ').option(' Two ').option(' Three ').list(); | ||
list.on('select', function (options) { | ||
console.log(options); | ||
process.exit(0); | ||
}); | ||
list.on('cancel', function (options) { | ||
console.log('Cancel list, ' + options.length + ' options selected'); | ||
process.exit(0); | ||
}); | ||
const result = yield cliSelect({ | ||
cleanup: false, | ||
inputStream: process.stdin, | ||
ouputStream: process.stdout, | ||
values, | ||
@@ -128,0 +143,0 @@ valueRenderer: (value, selected) => { |
{ | ||
"name": "actbase-cli", | ||
"version": "0.0.20", | ||
"version": "0.0.21", | ||
"description": "Actbase Command Line Interface", | ||
@@ -34,3 +34,4 @@ "author": "Trabricks LLC", | ||
"open": "^7.0.2", | ||
"plist": "^3.0.1" | ||
"plist": "^3.0.1", | ||
"select-shell": "^1.1.3" | ||
}, | ||
@@ -37,0 +38,0 @@ "devDependencies": { |
32987
697
8
+ Addedselect-shell@^1.1.3
+ Addedcolors@0.6.2(transitive)
+ Addedselect-shell@1.1.3(transitive)