Browse Source
* Ask for missing environment variables * Prettified * Use `info` helper * Only apply fields if `now` is available * Don't log * Isolate our Inquirer patch * Patch Inquirer before asking for the env fields * Don't ask for env vars that are already definedmaster
Leo Lamprecht
8 years ago
committed by
GitHub
3 changed files with 65 additions and 15 deletions
@ -0,0 +1,20 @@ |
|||
const inquirer = require('inquirer') |
|||
const chalk = require('chalk') |
|||
|
|||
// Here we patch inquirer to use a `>` instead of the ugly green `?`
|
|||
|
|||
/* eslint-disable no-multiple-empty-lines, no-var, no-undef, no-eq-null, eqeqeq, semi */ |
|||
const getQuestion = function() { |
|||
var message = chalk.bold('> ' + this.opt.message) + ' ' |
|||
|
|||
// Append the default if available, and if question isn't answered
|
|||
if (this.opt.default != null && this.status !== 'answered') { |
|||
message += chalk.dim('(' + this.opt.default + ') ') |
|||
} |
|||
|
|||
return message |
|||
} |
|||
/* eslint-enable */ |
|||
|
|||
inquirer.prompt.prompts.input.prototype.getQuestion = getQuestion |
|||
inquirer.prompt.prompts.list.prototype.getQuestion = getQuestion |
Loading…
Reference in new issue