|
|
|
|
|
|
|
|
child.stderr.on('data', (chunk) => { |
|
|
child.stderr.on('data', (chunk) => { |
|
|
if(messages.join('').indexOf('fatal: not a git repository') > -1) opts.haserrors = true; |
|
|
if(messages.join('').indexOf('fatal: not a git repository') > -1) opts.haserrors = true; |
|
|
messages.push(chunk); |
|
|
messages.push(chunk); |
|
|
process.stdout.write( chunk ) |
|
|
|
|
|
|
|
|
// process.stdout.write( chunk ) |
|
|
// console.error('stderr e: ' + chunk) |
|
|
// console.error('stderr e: ' + chunk) |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var prompt = function(choices, label, defaultchoice){ |
|
|
var prompt = function(choices, label, defaultchoice){ |
|
|
|
|
|
// prompt accepts either an array or an object as choices. |
|
|
var choices = choices || []; |
|
|
var choices = choices || []; |
|
|
return this.prompter.ask( |
|
|
return this.prompter.ask( |
|
|
`${label} \n` + Object.keys(choices).map(choice => { return ` ${(+choice) + 1}) ${choices[choice]} `}).join('\n') + `\n default ( <= ${ defaultchoice || choices[0]} ) : ` |
|
|
`${label} \n` + Object.keys(choices).map(choice => { return ` ${(+choice) + 1}) ${choices[choice]} `}).join('\n') + `\n default ( <= ${ defaultchoice || choices[0]} ) : ` |