How to use the inquirer.prompts function in inquirer

To help you get started, we’ve selected a few inquirer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Rebelizer / pellet / bin / pellet.js View on Github external
, nconf = require('nconf')
  , inquirer = require('inquirer')
  , utils = require('./utils')
  , version = require('../package.json').version
  , i;

process.env.SERVER_ENV = true;
process.env.BROWSER_ENV = false;

//todo: remove this because it was added for aws local run but I think I can use PELLET_CONF_DIR todo the same thing!
if(process.env.PELLET_DIR) {
  process.chdir(process.env.PELLET_DIR);
}

// monkey patch inquirer (nicer formatting)
for(i in inquirer.prompts) {
  inquirer.prompts[i].prototype.prefix = function (str) {
    return str;
  };
}

/**
 * search for the pellet config file
 * @param searchPath
 * @returns {*}
 */
function findPelletConfigFile(searchPath) {
  var filePath;

  searchPath = path.resolve(process.cwd(), searchPath);

  filePath = path.join(searchPath, '.pellet');
github Rebelizer / pellet / bin / pellet.js View on Github external
, inquirer = require('inquirer')
  , utils = require('./utils')
  , version = require('../package.json').version
  , i;

process.env.SERVER_ENV = true;
process.env.BROWSER_ENV = false;

//todo: remove this because it was added for aws local run but I think I can use PELLET_CONF_DIR todo the same thing!
if(process.env.PELLET_DIR) {
  process.chdir(process.env.PELLET_DIR);
}

// monkey patch inquirer (nicer formatting)
for(i in inquirer.prompts) {
  inquirer.prompts[i].prototype.prefix = function (str) {
    return str;
  };
}

/**
 * search for the pellet config file
 * @param searchPath
 * @returns {*}
 */
function findPelletConfigFile(searchPath) {
  var filePath;

  searchPath = path.resolve(process.cwd(), searchPath);

  filePath = path.join(searchPath, '.pellet');
  if (fs.existsSync(filePath)) {
github yeoman / generator / test / run-context.js View on Github external
this.ctx.on('end', function () {
        assert.equal(this.defaultInput, inquirer.prompts.input);
        done();
      }.bind(this));
    });
github yeoman / yeoman-test / test / run-context.js View on Github external
function() {
          assert.equal(this.defaultInput, inquirer.prompts.input);
          done();
        }.bind(this)
      );
github yeoman / yeoman-test / test / run-context.js View on Github external
beforeEach(function() {
    process.chdir(__dirname);

    this.defaultInput = inquirer.prompts.input;
    this.execSpy = sinon.spy();
    const execSpy = this.execSpy;
    this.Dummy = class extends Generator {
      exec(...args) {
        execSpy.apply(this, args);
      }
    };

    this.ctx = new RunContext(this.Dummy);
  });
github yeoman / generator / test / run-context.js View on Github external
beforeEach(function () {
    process.chdir(__dirname);

    this.defaultInput = inquirer.prompts.input;
    this.execSpy = sinon.spy();
    this.Dummy = generators.Base.extend({
      exec: this.execSpy
    });

    this.ctx = new RunContext(this.Dummy);
  });