Replaced fs.rename with mv

pull/46/head
Piero Toffanin 2018-09-12 14:51:16 -04:00
rodzic 1c9e149a7c
commit 72eb4a7453
2 zmienionych plików z 10 dodań i 8 usunięć

Wyświetl plik

@ -40,6 +40,7 @@ let odmOptions = require('./libs/odmOptions');
let Directories = require('./libs/Directories');
let unzip = require('node-unzip-2');
let si = require('systeminformation');
let mv = require('mv');
let auth = require('./libs/auth/factory').fromConfig(config);
const authCheck = auth.getMiddleware();
@ -197,7 +198,7 @@ app.post('/task/new', authCheck, addRequestId, upload.array('images'), (req, res
cb => fs.mkdir(destPath, undefined, cb),
cb => fs.mkdir(destGpcPath, undefined, cb),
cb => fs.rename(srcPath, destImagesPath, cb),
cb => mv(srcPath, destImagesPath, cb),
cb => {
@ -233,7 +234,7 @@ app.post('/task/new', authCheck, addRequestId, upload.array('images'), (req, res
else {
async.eachSeries(entries, (entry, cb) => {
if (/\.txt$/gi.test(entry)) {
fs.rename(path.join(destImagesPath, entry), path.join(destGpcPath, entry), cb);
mv(path.join(destImagesPath, entry), path.join(destGpcPath, entry), cb);
}else if (/\.zip$/gi.test(entry)){
fs.unlink(path.join(destImagesPath, entry), cb);
} else cb();

Wyświetl plik

@ -22,17 +22,18 @@
"dependencies": {
"archiver": "^1.0.0",
"async": "^2.0.0-rc.6",
"body-parser": "^1.15.2",
"express": "^4.14.0",
"body-parser": "^1.18.3",
"express": "^4.16.3",
"glob": "^7.1.1",
"mime": "^1.3.4",
"minimist": "^1.2.0",
"morgan": "^1.7.0",
"morgan": "^1.9.1",
"multer": "^1.1.0",
"mv": "^2.1.1",
"node-schedule": "^1.1.1",
"node-unzip-2": "^0.2.7",
"node-uuid": "^1.4.7",
"request": "^2.81.0",
"request": "^2.88.0",
"rimraf": "^2.5.3",
"swagger-jsdoc": "^1.3.1",
"systeminformation": "^3.42.0",
@ -40,9 +41,9 @@
"winston": "^2.2.0"
},
"devDependencies": {
"grunt": "^1.0.1",
"grunt": "^1.0.3",
"grunt-contrib-jshint": "^1.0.0",
"nodemon": "^1.9.2",
"nodemon": "^1.18.4",
"time-grunt": "^1.4.0"
}
}