Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
name: 'email',
message: 'your email address',
empty: false,
validator: /.+@.+/,
warning: 'not a valid email address'
});
}
if(ask.length)
{
if(!prompt.started)
prompt.start();
prompt.message = "";
prompt.delimiter = ">";
prompt.addProperties(config, ask, function(err)
{
process.stdin.destroy();
run.tests(config);
});
}
else
{
process.stdin.destroy();
run.tests(config);
}
}
};
function promptForOptions (obj, fields, cb) {
if (typeof(fields) === 'function') {
cb = fields;
fields = ['mount', 'remote'];
}
var properties = [];
prompt.start();
fields.forEach(function (val) {
if (!obj[val]) properties.push(val);
});
if (properties.length) {
prompt.addProperties(obj, properties, function (err) {
cb(obj);
});
} else {
cb(obj);
}
}
module.exports.process = function (context, callback) {
for (var i = this.prompt.length - 1; i >= 0; i--) {
if (_.isObject(this.prompt[i].pattern) && !_.isRegExp(this.prompt[i].pattern)) {
this.prompt[i].pattern = regex_helper.make_regex(this.prompt[i].pattern, context);
}
}
this.prompt = _.filter(this.prompt, function (item) {
return item.required || _.isUndefined(_.get(context.session, item.name));
});
prompt.override = context.sesion;
prompt.message = "hyperpotamus";
prompt.colors = false;
prompt.start();
prompt.addProperties(context.session, this.prompt, function () {
callback();
});
};