Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
, 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');
, 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)) {
this.ctx.on('end', function () {
assert.equal(this.defaultInput, inquirer.prompts.input);
done();
}.bind(this));
});
function() {
assert.equal(this.defaultInput, inquirer.prompts.input);
done();
}.bind(this)
);
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);
});
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);
});