Whitespace

This commit is contained in:
Tim Schaub
2016-01-02 11:26:31 -07:00
parent 23f3e21ba4
commit 38d0e98ff5
4 changed files with 11 additions and 13 deletions

View File

@@ -48,7 +48,7 @@ function getLinkToApiHtml(requires) {
var lis = requires.map(function(symb) { var lis = requires.map(function(symb) {
var href = '../apidoc/' + symb + '.html'; var href = '../apidoc/' + symb + '.html';
return '<li><a href="' + href + '" title="API documentation for ' + return '<li><a href="' + href + '" title="API documentation for ' +
symb +'">' + symb + '</a></li>'; symb + '">' + symb + '</a></li>';
}); });
return '<ul class="inline">' + lis.join() + '</ul>'; return '<ul class="inline">' + lis.join() + '</ul>';
} }

View File

@@ -44,7 +44,7 @@ var copyOpts = {
/** /**
* A small utility method printing out log messages. * A small utility method printing out log messages.
*/ */
var log = function(msg){ var log = function(msg) {
process.stdout.write(msg + '\n'); process.stdout.write(msg + '\n');
}; };
@@ -56,10 +56,10 @@ var log = function(msg){
* adjusted to use path.join * adjusted to use path.join
*/ */
var deleteFolderRecursive = function(p) { var deleteFolderRecursive = function(p) {
if( fs.existsSync(p) ) { if (fs.existsSync(p)) {
fs.readdirSync(p).forEach(function(file,index){ fs.readdirSync(p).forEach(function(file,index) {
var curPath = path.join(p, file); var curPath = path.join(p, file);
if(fs.lstatSync(curPath).isDirectory()) { // recurse if (fs.lstatSync(curPath).isDirectory()) { // recurse
deleteFolderRecursive(curPath); deleteFolderRecursive(curPath);
} else { // delete file } else { // delete file
fs.unlinkSync(curPath); fs.unlinkSync(curPath);
@@ -73,7 +73,7 @@ var deleteFolderRecursive = function(p) {
* Creates folders for backup and instrumentation and copies the contents of the * Creates folders for backup and instrumentation and copies the contents of the
* current src folder into them. * current src folder into them.
*/ */
var setupBackupAndInstrumentationDir = function(){ var setupBackupAndInstrumentationDir = function() {
if (!fs.existsSync(backupDir)) { if (!fs.existsSync(backupDir)) {
log('• create directory for backup of src: ' + backupDir); log('• create directory for backup of src: ' + backupDir);
fs.mkdirSync(backupDir); fs.mkdirSync(backupDir);
@@ -95,7 +95,7 @@ var setupBackupAndInstrumentationDir = function(){
* backup over the src directory and removes the instrumentation and backup * backup over the src directory and removes the instrumentation and backup
* directory. * directory.
*/ */
var revertBackupAndInstrumentationDir = function(){ var revertBackupAndInstrumentationDir = function() {
log('• copy original src back to src folder'); log('• copy original src back to src folder');
wrench.copyDirSyncRecursive(backupDir, dir, copyOpts); wrench.copyDirSyncRecursive(backupDir, dir, copyOpts);
log('• delete backup directory'); log('• delete backup directory');
@@ -120,7 +120,7 @@ var collectAndWriteCoverageData = function(code) {
revertBackupAndInstrumentationDir(); revertBackupAndInstrumentationDir();
log('• write report from collected data'); log('• write report from collected data');
reporter.write(collector, true, function () { reporter.write(collector, true, function() {
process.exit(0); process.exit(0);
}); });
}; };
@@ -168,7 +168,7 @@ var foundAllJavaScriptSourceFiles = function(err, files) {
* coverage process by gathering all JavaScript files and then instrumenting * coverage process by gathering all JavaScript files and then instrumenting
* them. * them.
*/ */
var main = function(){ var main = function() {
setupBackupAndInstrumentationDir(); setupBackupAndInstrumentationDir();
glob(dir + '/**/*.js', {}, foundAllJavaScriptSourceFiles); glob(dir + '/**/*.js', {}, foundAllJavaScriptSourceFiles);
}; };
@@ -180,5 +180,3 @@ if (require.main === module) {
} }
module.exports = main; module.exports = main;

View File

@@ -82,7 +82,7 @@ function runTests(includeCoverage, callback) {
} }
if (require.main === module) { if (require.main === module) {
runTests(false, function(code){ runTests(false, function(code) {
process.exit(code); process.exit(code);
}); });
} }