list stuff
This commit is contained in:
parent
bcdd3cd951
commit
32ad1103bc
|
@ -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);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue