mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-21 02:29:23 +00:00
refactor(commander) getDirContent
This commit is contained in:
parent
07c39de889
commit
7d19de318c
1 changed files with 5 additions and 8 deletions
|
|
@ -22,15 +22,12 @@
|
|||
WIN32 = process.platform === 'win32';
|
||||
|
||||
exports.getDirContent = function(path, callback) {
|
||||
var isString = Util.isString(path);
|
||||
Util.checkArgs(arguments, ['path', 'callback']);
|
||||
|
||||
if (!isString)
|
||||
Util.exec(callback, 'First parameter should be a string');
|
||||
else
|
||||
fs.readdir(path, readDir.bind(null, {
|
||||
callback : callback,
|
||||
path : path
|
||||
}));
|
||||
fs.readdir(path, readDir.bind(null, {
|
||||
callback : callback,
|
||||
path : path
|
||||
}));
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue