Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Object.keys(pkg.dependencies).forEach(function(depName) {
// global task name should begin with grunt
if (!/^grunt/.test(depName)) return;
var filepath = path.join(rootdir, 'node_modules', depName);
if (grunt.file.exists(filepath)) {
// Load this task plugin recursively
grunt.loadGlobalTasks(path.relative(NODE_PATH, filepath));
}
});
// Load the tasks of itself
// The code gen directive line automatically qualifies
outputLines.push(line);
// pass transform settings to transform (match[1] is the equals sign, ensure it exists but otherwise ignore it)
outputLines.push.apply(outputLines, transformer.transform(fileToProcess, match[1] && match[2] && match[2].trim()));
return true;
}
return false;
})) {
continue;
}
// Lines not generated or not directives
outputLines.push(line);
}
var transformedContent = outputLines.join(utils.eol);
if (transformedContent !== contents) {
grunt.file.write(fileToProcess, transformedContent);
}
});
}
'setUp': function(done) {
// ensure that your `ulimit -n` is higher than amount of files
if (grunt.file.exists(watchDir)) {
grunt.file.delete(watchDir, {force:true});
}
createFiles(100, path.join(watchDir, 'one'));
createFiles(100, path.join(watchDir, 'two'));
createFiles(100, path.join(watchDir, 'three'));
createFiles(100, path.join(watchDir, 'three', 'four'));
createFiles(100, path.join(watchDir, 'three', 'four', 'five', 'six'));
process.chdir(watchDir);
done();
},
'tearDown': function(done) {
var compare = function(inputFile, expectedOutputFile, description, test) {
var actual = grunt.file.read(inputFile);
var expected = grunt.file.read(expectedOutputFile);
test.equal(actual, expected, description);
test.done();
};
exec('grunt dot:node', function(error, stdout, stderr) {
nodeTmpl = grunt.file.read('test/output/tmpl.js');
done();
});
});
exec('grunt dot:requirejs', function(error, stdout, stderr) {
requirejsTmpl = grunt.file.read('test/output/tmpl.js');
done();
});
});
Helpers.checkString = function (regStr, file) {
var configFile = grunt.file.read(file),
patt = new RegExp(regStr);
return patt.test(configFile);
};
function cardPackage(dirname) {
return grunt.file.readJSON('cards/' + dirname + '/package.json' );
}
markdown += grunt.template.process(template.module, { data: {
module: z
}});
for (var i = 0, el; el = logdata[x][z][i]; i++) {
markdown += grunt.template.process(template.item, { data: {
subject: el.subject,
issueNo: el.issueNo,
url: grunt.config("exec.changelog.issueURL"),
hash: el.hash
}});
}
}
}
grunt.file.write("CHANGELOG.md", markdown, { encoding: "UTF-8" });
},
stdout: false