Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
grunt.registerTask('taskvalidator', 'validate if a task exist', function(taskname) {
if(!taskname || !taskname.length) {
grunt.fatal('Cannot run this task without task name');
}
grunt.log.writeln(taskname + ' exists: ' + grunt.task.exists(taskname));
});
handle: function(err){
if(err){
grunt.log.writeln('failed.');
grunt.fatal(err);
}
grunt.log.writeln('done.');
}
};
function parse(stdout){
var result = JSON.parse(stdout);
var instances = _.pluck(result.Reservations, 'Instances');
var flat = _.flatten(instances);
if (flat.length > 1) {
grunt.fatal('Found more than one instance tagged ' + chalk.magenta(name));
}
done(flat[0]);
}
};
onComplete: function(passed) {
if (!passed) {
grunt.fatal('tests failed');
}
},
onError: function(error) {
.pipe(require('coverify/parse')(function(error, results) {
if (error) {
grunt.fatal(error);
}
Object.keys(results)
.sort(function(a, b) {
return results[a].length - results[b].length;
})
.reverse()
.forEach(function(concretePath) {
if (results[concretePath].length === 0) {
return;
}
var relativePath = concretePath.replace(ROOT, '');
uncoveredExpressionCount += results[concretePath].length;
grunt.log.error(results[concretePath].length + ' expressions not covered ' + relativePath);
results[concretePath].forEach(function(c) {
sshCredentials(name, function (c) {
if (!c) {
grunt.fatal('This instance is refusing SSH connections for now');
}
var verbosity = conf('VERBOSITY_RSYNC');
var user = conf('AWS_RSYNC_USER');
var include = clud(opts.includes, 'include');
var includeFrom = cludFrom(opts.includeFrom, 'include');
var exclude = clud(opts.excludes, 'exclude');
var excludeFrom = cludFrom(opts.excludeFrom, 'exclude');
grunt.log.writeln('Deploying %s to %s using rsync over ssh...', chalk.blue(opts.name), chalk.cyan(c.id));
var args = ['a', 'z'];
var eo = {};
if (verbosity) {
eo.buffer = 20000 * 1024;
function ready (err, stream) {
if (err) { grunt.fatal('Connection error.\n\n', err); }
grunt.log.ok('Connection established! Use ctrl+c twice to exit ssh session');
shell = stream;
shell.on('data', read.bind(null, options.chalk));
shell.on('error', fatal);
shell.on('exit', exitCommand);
resume();
}
cachedAngularFiles.forEach(function(f) {
var filePath = path.join('lib', 'test', 'angular', version, f);
if (! fs.existsSync(filePath)) {
grunt.fatal("Angular file " + filePath + " doesn't exist");
}
retFiles.push(filePath);
});
onError: function(error) {
grunt.fatal(error);
},
});
function parse(stdout){
var result = JSON.parse(stdout);
var instances = _.pluck(result.Reservations, 'Instances');
var flat = _.flatten(instances);
if (flat.length > 1) {
grunt.fatal('Found more than one instance tagged ' + chalk.magenta(name));
} else if (flat.length === 0) {
grunt.fatal('There are no instances tagged ' + chalk.magenta(name));
}
done(flat[0]);
}
};