list stuff

This commit is contained in:
AJ ONeal 2018-06-21 19:28:20 +00:00
parent bcdd3cd951
commit 32ad1103bc
1 changed files with 7 additions and 1 deletions

View File

@ -493,6 +493,7 @@ function parseConfig(err, text) {
askForConfig(answers, function (err, answers) { askForConfig(answers, function (err, answers) {
if (!answers.token && answers._can_pair) { if (!answers.token && answers._can_pair) {
answers._otp = common.otp(); answers._otp = common.otp();
console.log("");
console.log("=============================================="); console.log("==============================================");
console.log(" Hey, Listen! "); console.log(" Hey, Listen! ");
console.log("=============================================="); console.log("==============================================");
@ -502,14 +503,19 @@ function parseConfig(err, text) {
console.log(" DEVICE PAIR CODE: 0000 ".replace(/0000/g, answers._otp)); console.log(" DEVICE PAIR CODE: 0000 ".replace(/0000/g, answers._otp));
console.log(" "); console.log(" ");
console.log("=============================================="); console.log("==============================================");
console.log("");
} }
// TODO use php-style object querification // TODO use php-style object querification
putConfig('config', Object.keys(answers).map(function (key) { putConfig('config', Object.keys(answers).map(function (key) {
return key + ':' + answers[key]; return key + ':' + answers[key];
}), function (err, body) { }), function (err, body) {
if (err) {
console.error("Error while initializing config:");
console.error(err);
}
// need just a little time to let the grants occur // need just a little time to let the grants occur
setTimeout(function () { setTimeout(function () {
makeRpc('list'); putConfig('list', []);
}, 1 * 1000); }, 1 * 1000);
}); });