update to support dots as usual

This commit is contained in:
2017-08-09 16:30:30 +02:00
parent 8b6a15388e
commit 2a45270902
5 changed files with 57 additions and 24 deletions

View File

@ -60,10 +60,18 @@ export class SmartInteract {
choices: optionsArg.choices,
validate: optionsArg.validate
}]).then((answers: IAnswerObject[]) => {
// adjust to the fact that now dots define paths for inquirer
let answerValue: any = answers
let nameArray = optionsArg.name.split('.')
for (let name of nameArray) {
answerValue = answerValue[name]
}
done.resolve({
name: optionsArg.name,
value: answers[ optionsArg.name ]
value: answerValue
})
}).catch(err => {
console.log(err)
})
} else {
let answer: IAnswerObject = {