From 6a2e62eb6380b714cd2c36bf77405b6be7a672c4 Mon Sep 17 00:00:00 2001 From: Alexandre Beaudoin Date: Fri, 29 May 2015 23:00:54 -0400 Subject: [PATCH] Clean .gitignore file. And code reformatting. --- .gitignore | 18 ------------------ lib/fileSystem.js | 14 +++++++------- test/test.js | 2 +- 3 files changed, 8 insertions(+), 26 deletions(-) diff --git a/.gitignore b/.gitignore index bdfaf74..2ff73a6 100644 --- a/.gitignore +++ b/.gitignore @@ -4,31 +4,13 @@ logs *.log -# Runtime data -pids -*.pid -*.seed - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) .grunt -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release # Dependency directory -# Commenting this out is preferred by some people, see -# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- node_modules -# Users Environment Variables -.lock-wscript - .idea *.iml diff --git a/lib/fileSystem.js b/lib/fileSystem.js index 0b4ecb2..4bfff98 100644 --- a/lib/fileSystem.js +++ b/lib/fileSystem.js @@ -124,7 +124,7 @@ fs.copyQ = function(from, to) { */ fs.rmdirR = function(path, callback) { fs.readdir(path, function(err, files) { - if(err) { + if (err) { // Pass the error on to callback callback(err, []); return; @@ -134,26 +134,26 @@ fs.rmdirR = function(path, callback) { folderDone = function(err) { count++; // If we cleaned out all the files, continue - if( count >= wait || err) { - fs.rmdir(path,callback); + if (count >= wait || err) { + fs.rmdir(path, callback); } }; // Empty directory to bail early - if(!wait) { + if (!wait) { folderDone(); return; } // Remove one or more trailing slash to keep from doubling up - path = path.replace(/\/+$/,""); + path = path.replace(/\/+$/, ""); files.forEach(function(file) { var curPath = path + "/" + file; fs.lstat(curPath, function(err, stats) { - if( err ) { + if (err) { callback(err, []); return; } - if( stats.isDirectory() ) { + if (stats.isDirectory()) { fs.rmdirR(curPath, folderDone); } else { fs.unlink(curPath, folderDone); diff --git a/test/test.js b/test/test.js index 131b40c..605051f 100644 --- a/test/test.js +++ b/test/test.js @@ -312,7 +312,7 @@ var test = [ errors.push("Test" + currentTest + " error: The angular.js file was not copy by the command runMinR()."); } - var bc = path.join(__dirname, "test0/bower_components"); + var bc = path.join(__dirname, "test0/bower_components"); if (fs.existsSync(bc)) { fs.removeSync(bc); }