mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
fix(commander) changeUIDToName: doesn't work on win
This commit is contained in:
parent
45029a4904
commit
d792215480
1 changed files with 20 additions and 19 deletions
|
|
@ -152,34 +152,35 @@
|
|||
|
||||
json.files = changeOrder(files);
|
||||
|
||||
changeUIDToName(json, function(json) {
|
||||
changeUIDToName(json, function() {
|
||||
Util.exec(p.callback, null, json);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function changeUIDToName(json, callback) {
|
||||
Util.ifExec(WIN32, callback, function() {
|
||||
users.getNames(function(error, names) {
|
||||
var i, n, current, owner,
|
||||
files = json.files;
|
||||
|
||||
Util.log(error);
|
||||
|
||||
n = files.length;
|
||||
for (i = 0; i < n; i++) {
|
||||
current = files[i];
|
||||
Util.ifExec(WIN32, callback,
|
||||
function(callback) {
|
||||
users.getNames(function(error, names) {
|
||||
var i, n, current, owner,
|
||||
files = json.files;
|
||||
|
||||
owner = current.owner;
|
||||
owner = names[owner];
|
||||
Util.log(error);
|
||||
|
||||
if (owner)
|
||||
current.owner = owner;
|
||||
}
|
||||
|
||||
Util.exec(callback, json);
|
||||
n = files.length;
|
||||
for (i = 0; i < n; i++) {
|
||||
current = files[i];
|
||||
|
||||
owner = current.owner;
|
||||
owner = names[owner];
|
||||
|
||||
if (owner)
|
||||
current.owner = owner;
|
||||
}
|
||||
|
||||
Util.exec(callback);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue