actbase-cli
Advanced tools
Comparing version 0.0.23 to 0.0.24
@@ -276,27 +276,15 @@ "use strict"; | ||
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.value; | ||
file.actbase.codepush = null; | ||
} | ||
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; | ||
file.appcenter_and = keyData.value; | ||
file.actbase.codepush = null; | ||
} | ||
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) { | ||
@@ -303,0 +291,0 @@ file.actbase.codepush = yield install(file); |
@@ -89,3 +89,2 @@ "use strict"; | ||
console.log(' '); | ||
_config.output = output; | ||
@@ -107,3 +106,2 @@ } | ||
console.log(' '); | ||
_config.path = path; | ||
@@ -141,3 +139,3 @@ } | ||
yield (0, _utils.writeFile)(savePath, text); | ||
console.log(savePath + ' 저장 완료!'); | ||
console.log(` ==> ${savePath} 저장 완료!`); | ||
} | ||
@@ -144,0 +142,0 @@ } else if (_config.path.indexOf('/edit#gid=') >= 0) { |
@@ -19,8 +19,2 @@ "use strict"; | ||
const cliSelect = require('cli-select'); | ||
const selectShell = require('select-shell'); | ||
const chalk = require('chalk'); | ||
const inquirer = require('inquirer'); | ||
@@ -73,15 +67,19 @@ | ||
const readText = question => { | ||
return new Promise((resolve, reject) => { | ||
const r = readline.createInterface({ | ||
input: process.stdin, | ||
output: process.stdout | ||
}); | ||
r.question(question, data => { | ||
r.close(); | ||
resolve(data); | ||
}); | ||
const readText = | ||
/*#__PURE__*/ | ||
function () { | ||
var _ref = _asyncToGenerator(function* (message) { | ||
const answers = yield inquirer.prompt([{ | ||
type: 'input', | ||
name: 'input', | ||
message | ||
}]); | ||
return answers.input; | ||
}); | ||
}; | ||
return function readText(_x) { | ||
return _ref.apply(this, arguments); | ||
}; | ||
}(); | ||
exports.readText = readText; | ||
@@ -92,3 +90,3 @@ | ||
function () { | ||
var _ref = _asyncToGenerator(function* () { | ||
var _ref2 = _asyncToGenerator(function* () { | ||
const file = JSON.parse((yield readFile('./package.json'))); | ||
@@ -117,3 +115,3 @@ | ||
return function getPackageJson() { | ||
return _ref.apply(this, arguments); | ||
return _ref2.apply(this, arguments); | ||
}; | ||
@@ -124,45 +122,28 @@ }(); | ||
const select = (message, values) => { | ||
// return new Promise((resolve, reject) => { | ||
// console.log(message); | ||
try { | ||
inquirer.prompt([{ | ||
type: 'list', | ||
name: 'theme', | ||
message: 'What do you want to do?', | ||
choices: ['Order a pizza', 'Make a reservation', new inquirer.Separator(), 'Ask for opening hours', { | ||
name: 'Contact support', | ||
disabled: 'Unavailable at this time' | ||
}, 'Talk to the receptionist'] | ||
}, { | ||
type: 'list', | ||
name: 'size', | ||
message: 'What size do you need?', | ||
choices: ['Jumbo', 'Large', 'Standard', 'Medium', 'Small', 'Micro'], | ||
filter: function filter(val) { | ||
return val.toLowerCase(); | ||
} | ||
}]).then(answers => { | ||
console.log(JSON.stringify(answers, null, ' ')); | ||
}); // | ||
// const result = await cliSelect({ | ||
// cleanup: false, | ||
// inputStream: process.stdin, | ||
// ouputStream: process.stdout, | ||
// values, | ||
// valueRenderer: (value, selected) => { | ||
// if (selected) { | ||
// return chalk.underline(value); | ||
// } | ||
// return value; | ||
// }, | ||
// }); | ||
const select = | ||
/*#__PURE__*/ | ||
function () { | ||
var _ref3 = _asyncToGenerator(function* (message, choices) { | ||
try { | ||
const answers = yield inquirer.prompt([{ | ||
type: 'list', | ||
name: 'input', | ||
message, | ||
choices | ||
}]); | ||
const result = { | ||
value: answers.input, | ||
id: choices.indexOf(answers.input) | ||
}; | ||
return result; | ||
} catch (e) { | ||
process.exit(1); | ||
} | ||
}); | ||
console.log(' ==> ' + result.value + '\n'); // return result; | ||
} catch (e) { | ||
process.exit(1); | ||
} // }); | ||
return function select(_x2, _x3) { | ||
return _ref3.apply(this, arguments); | ||
}; | ||
}(); | ||
}; | ||
exports.select = select; | ||
@@ -169,0 +150,0 @@ var _default = { |
{ | ||
"name": "actbase-cli", | ||
"version": "0.0.23", | ||
"version": "0.0.24", | ||
"description": "Actbase Command Line Interface", | ||
@@ -5,0 +5,0 @@ "author": "Trabricks LLC", |
31861
673