From a4666d3978cfdf3bb7bc9d58194c10aa24d126c6 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 20 Aug 2014 02:45:35 -0400 Subject: [PATCH] feature(readify) commander.getDirContent -> readify --- lib/server/console.js | 3 ++- lib/server/flop.js | 4 ++-- lib/server/{commander.js => readify.js} | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) rename lib/server/{commander.js => readify.js} (98%) diff --git a/lib/server/console.js b/lib/server/console.js index 6319b1c8..fdb1db18 100644 --- a/lib/server/console.js +++ b/lib/server/console.js @@ -218,6 +218,7 @@ error = Util.exec.tryLog(function() { cmd = spawn(сommand, args, options); + //cmd = exec(сommand, options); }); if (error) { @@ -241,7 +242,7 @@ sendError(errorStr); }); - cmd.on('close', function () { + cmd.on('close', function() { cmd = null; if (!isSended) diff --git a/lib/server/flop.js b/lib/server/flop.js index cac4e97e..b609e5d8 100644 --- a/lib/server/flop.js +++ b/lib/server/flop.js @@ -11,7 +11,7 @@ Util = require(DIR + '../util'), size = require(DIR + 'size'), - commander = require(DIR + 'commander'), + readify = require(DIR + 'readify'), time = require(DIR + 'timem'), pipe = require(DIR + 'pipe'), ncp = require(DIR + 'ncp'), @@ -49,7 +49,7 @@ break; default: - commander.getDirContent(path, callback); + readify(path, callback); break; } }; diff --git a/lib/server/commander.js b/lib/server/readify.js similarity index 98% rename from lib/server/commander.js rename to lib/server/readify.js index 44fea160..a411e5cf 100644 --- a/lib/server/commander.js +++ b/lib/server/readify.js @@ -21,7 +21,7 @@ WIN32 = process.platform === 'win32'; - exports.getDirContent = function(path, callback) { + module.exports = function(path, callback) { Util.checkArgs(arguments, ['path', 'callback']) .checkType('path', path, 'string') .checkType('callback', callback, 'function');