Skip to content

Commit

Permalink
Files: use fs.extra.move instead of fs.rename. The latter doesnt supp…
Browse files Browse the repository at this point in the history
…ort renaming from different partitions (so it doesnt work with docker volumes).
  • Loading branch information
Enome committed Nov 17, 2013
1 parent 228e7c1 commit e36e6ff
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions files/middleware.js
@@ -1,4 +1,4 @@
var fs = require('fs');
var fs = require('fs.extra');
var path = require('path');
var async = require('async');
var rimraf = require('rimraf');
Expand Down Expand Up @@ -146,7 +146,7 @@ var middleware = {

var path = res.locals.absolute_path + '/' + req.files.file.name;

fs.rename(req.files.file.path, path, function (err, response) {
fs.move(req.files.file.path, path, function (err, response) {
res.send(err, 200);
});

Expand All @@ -170,7 +170,7 @@ var middleware = {

updateDirectory: function (req, res, next) {

fs.rename(res.locals.absolute_path + '/' + req.body.old_name, res.locals.absolute_path + '/' + req.body.name, function (err) {
fs.move(res.locals.absolute_path + '/' + req.body.old_name, res.locals.absolute_path + '/' + req.body.name, function (err) {
next(err);
});

Expand Down
5 changes: 3 additions & 2 deletions files/package.json
@@ -1,11 +1,12 @@
{
"author": "Geert Pasteels <geert.pasteels@gmail.com>",
"name": "jungles-files",
"version": "2.0.0",
"version": "2.1.0",
"description": "File server for jungles",
"dependencies": {
"express": "~3.3.4",
"async": "~0.2.9",
"rimraf": "~2.2.2"
"rimraf": "~2.2.2",
"fs.extra": "~1.2.1"
}
}
4 changes: 2 additions & 2 deletions jungles/package.json
Expand Up @@ -2,7 +2,7 @@
"author": "Geert Pasteels <geert.pasteels@gmail.com>",
"name": "jungles",
"description": "Jungles Content Management System",
"version": "4.0.1",
"version": "4.1.0",
"keywords": [
"jungles",
"cms"
Expand All @@ -23,7 +23,7 @@
"jungles-helpers-frontend": "~2.0.0",
"jungles-rest": "~3.0.0",
"jungles-panel": "~5.0.1",
"jungles-files": "~2.0.0"
"jungles-files": "~2.1.0"
},
"devDependencies": {}
}

0 comments on commit e36e6ff

Please sign in to comment.