[Groonga-commit] groonga/gcs [master] Fix missing function "isDirectory"

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Dec 7 13:01:04 JST 2012


YUKI Hiroshi	2012-12-07 13:01:04 +0900 (Fri, 07 Dec 2012)

  New Revision: 7953050428ff9a157cb66fae7a71b70e05a65675
  https://github.com/groonga/gcs/commit/7953050428ff9a157cb66fae7a71b70e05a65675

  Log:
    Fix missing function "isDirectory"

  Modified files:
    lib/rm.js
    test/test-utils.js

  Modified: lib/rm.js (+5 -1)
===================================================================
--- lib/rm.js    2012-12-07 12:57:17 +0900 (125aa68)
+++ lib/rm.js    2012-12-07 13:01:04 +0900 (e24a08d)
@@ -1,6 +1,10 @@
 var fs = require('fs');
 var path = require('path');
 
+function isDirectorySync(path) {
+  return fs.statSync(path).isDirectory();
+}
+
 function rmRSync(directoryPath) {
   if (!path.existsSync(directoryPath)) return;
 
@@ -9,7 +13,7 @@ function rmRSync(directoryPath) {
   for (var i = 0, maxi = files.length; i < maxi; i++) {
     file = files[i];
     filePath = path.join(directoryPath, file);
-    if (isDirectory(filePath))
+    if (isDirectorySync(filePath))
       rmRSync(filePath);
     else
       fs.unlinkSync(filePath);

  Modified: test/test-utils.js (+0 -5)
===================================================================
--- test/test-utils.js    2012-12-07 12:57:17 +0900 (146e60d)
+++ test/test-utils.js    2012-12-07 13:01:04 +0900 (9250933)
@@ -129,11 +129,6 @@ exports.loadDumpFile = function(context, path) {
   });
 }
 
-function isDirectory(path) {
-  return fs.statSync(path).isDirectory();
-}
-exports.isDirectory = isDirectory;
-
 exports.rmRSync = rmRSync;
 
 function XMLStringToJSON(xml) {
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index