mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
refactor(rest) onFS: rm Util.call
This commit is contained in:
parent
959c24564e
commit
5f05bab56f
1 changed files with 6 additions and 13 deletions
|
|
@ -170,7 +170,7 @@
|
|||
});
|
||||
|
||||
if (diffResult && !ret)
|
||||
fs.writeFile(name, diffResult, Util.call(write, params));
|
||||
fs.writeFile(name, diffResult, write.bind(null, name));
|
||||
else {
|
||||
name = path.basename(name);
|
||||
sendMsg(params, 'patch', name, 'fail');
|
||||
|
|
@ -178,19 +178,12 @@
|
|||
});
|
||||
}
|
||||
|
||||
function write(params) {
|
||||
var p, lName,
|
||||
ret = main.checkCallBackParams(params) &&
|
||||
main.checkParams(params.params);
|
||||
|
||||
if (ret) {
|
||||
p = params;
|
||||
function write(name, error) {
|
||||
checkSendError(error, params, function() {
|
||||
name = path.basename(name);
|
||||
|
||||
checkSendError(p.error, p.params, function() {
|
||||
lName = path.basename(p.params.name);
|
||||
sendMsg(p.params, 'patch', lName);
|
||||
});
|
||||
}
|
||||
sendMsg(params, 'patch', name);
|
||||
});
|
||||
}
|
||||
});
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue