diff options
author | Johannes Zellner <johannes@nebulon.de> | 2015-06-27 17:28:23 +0200 |
---|---|---|
committer | Johannes Zellner <johannes@nebulon.de> | 2015-06-27 17:28:23 +0200 |
commit | eb83e4daa3726d3e7f12c513a19d212b709dadff (patch) | |
tree | 00b2b5c41cffbe738d23cc2a026fa62a97358d90 /src | |
parent | 8c3ae0719e1f7d266ee04d86e7e1c3756745d372 (diff) | |
download | Surfer-eb83e4daa3726d3e7f12c513a19d212b709dadff.tar.gz Surfer-eb83e4daa3726d3e7f12c513a19d212b709dadff.tar.zst Surfer-eb83e4daa3726d3e7f12c513a19d212b709dadff.zip |
Use del instead of rimraf
Diffstat (limited to 'src')
-rw-r--r-- | src/files.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/files.js b/src/files.js index 48f91a8..6946ff3 100644 --- a/src/files.js +++ b/src/files.js | |||
@@ -3,7 +3,7 @@ | |||
3 | var fs = require('fs'), | 3 | var fs = require('fs'), |
4 | path = require('path'), | 4 | path = require('path'), |
5 | ejs = require('ejs'), | 5 | ejs = require('ejs'), |
6 | rimraf = require('rimraf'), | 6 | rm = require('del'), |
7 | debug = require('debug')('files'), | 7 | debug = require('debug')('files'), |
8 | mkdirp = require('mkdirp'), | 8 | mkdirp = require('mkdirp'), |
9 | HttpError = require('connect-lastmile').HttpError, | 9 | HttpError = require('connect-lastmile').HttpError, |
@@ -116,9 +116,9 @@ function del(req, res, next) { | |||
116 | fs.stat(absoluteFilePath, function (error, result) { | 116 | fs.stat(absoluteFilePath, function (error, result) { |
117 | if (error) return next(new HttpError(404, error)); | 117 | if (error) return next(new HttpError(404, error)); |
118 | 118 | ||
119 | rimraf(absoluteFilePath, function (error) { | 119 | rm(absoluteFilePath, function (error, result) { |
120 | if (error) return next(new HttpError(500, 'Unable to remove')); | 120 | if (error) return next(new HttpError(500, 'Unable to remove')); |
121 | next(new HttpSuccess(200, {})); | 121 | next(new HttpSuccess(200, { entries: result })); |
122 | }); | 122 | }); |
123 | }); | 123 | }); |
124 | } | 124 | } |