mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 18:18:56 +00:00
refactor(commander) getDirContent: add bind
This commit is contained in:
parent
7aea0483a6
commit
d1921dce96
1 changed files with 5 additions and 7 deletions
|
|
@ -25,12 +25,10 @@
|
|||
if (!ret)
|
||||
Util.exec(callback, "First parameter should be a string");
|
||||
else
|
||||
fs.readdir(path, function(error, files) {
|
||||
readDir(error, files, {
|
||||
callback : callback,
|
||||
path : path
|
||||
});
|
||||
});
|
||||
fs.readdir(path, readDir.bind(null, {
|
||||
callback : callback,
|
||||
path : path
|
||||
}));
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
|
@ -41,7 +39,7 @@
|
|||
* @param pError
|
||||
* @param pFiles
|
||||
*/
|
||||
function readDir(error, files, params) {
|
||||
function readDir(params, error, files) {
|
||||
var i, n, stats, filesData, fill, name, fileParams,
|
||||
|
||||
p = params,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue