fix(commander) changeUIDToName: doesn't work on win

This commit is contained in:
coderaiser 2014-02-13 09:14:17 -05:00
parent 45029a4904
commit d792215480

View file

@ -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);
});
});
});
}