Skip to content

Commit

Permalink
Merge pull request #64 from wistityhq/fix/windows
Browse files Browse the repository at this point in the history
Fix path for Windows
  • Loading branch information
Lo茂c Saint-Roch committed Jan 14, 2016
2 parents 0f650ba + b17a31c commit 88abd1c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/configuration/hooks/studio/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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) {
Expand Down

0 comments on commit 88abd1c

Please sign in to comment.