Fix rename

Signed-off-by: James Ketrenos <james_git@ketrenos.com>
This commit is contained in:
James Ketr 2018-08-28 19:35:14 -07:00
parent 570b1bc2fb
commit fb4b1e42d5

View File

@ -238,13 +238,14 @@ function convertNefToJpg(path, file) {
if (code != 0) {
return reject("UFRAW for " + path + "/" + file + " returned an error: " + code);
}
fs.rename(path + "/" + file, path + "/raw/" + path, function(err) {
if (err) {
console.error("Unable to move RAW file: " + path + "/" + file);
return reject(err);
} else {
return mkdirPromise(path + "/raw").then(function() {
fs.rename(path + "/" + file, path + "/raw/" + file, function(err) {
if (err) {
console.error("Unable to move RAW file: " + path + "/" + file);
return reject(err);
}
return resolve();
}
});
});
});
});