Fix path for Windows

This commit is contained in:
Aurélien Georget 2016-01-12 23:18:37 +01:00
parent 0f650ba780
commit b17a31c518

View File

@ -448,7 +448,8 @@ module.exports = function (strapi) {
deferred.reject(err);
}
const fileToUnzip = path.resolve(strapi.config.appPath, '.tmp', derivedKey.toString('hex') + '.zip');
// Force posix to be fully compatible with the Studio server
const fileToUnzip = path.posix.normalize(path.join(strapi.config.appPath, '.tmp', derivedKey.toString('hex') + '.zip'));
request({
method: 'POST',
@ -467,12 +468,12 @@ module.exports = function (strapi) {
.on('close', function () {
let folderDest;
const folderOrFiletoRemove = path.resolve(data.dest);
const folderOrFiletoRemove = path.normalize(data.dest);
if (data.src === 'api') {
folderDest = folderOrFiletoRemove;
} else {
folderDest = path.resolve(data.dest, '..');
folderDest = path.join(data.dest, '..');
}
fs.remove(folderOrFiletoRemove, function (err) {