Skip to content

Commit

Permalink
Fix path.sep with '/'; use splice instead of slice
Browse files Browse the repository at this point in the history
  • Loading branch information
vilicvane committed May 27, 2016
1 parent 3826514 commit 1e552d1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ module.exports = function (zipPath, opts, cb) {
}

var strip = opts.strip || 0
var filenameParts = entry.fileName.split(path.sep)
var destParts = [opts.dir].concat(filenameParts.slice(strip))
var filenameParts = entry.fileName.split('/')
filenameParts.splice(0, Math.min(strip, filenameParts.length - 1))
var destParts = [opts.dir].concat(filenameParts)
var dest = path.join.apply(path, destParts)

// convert external file attr int into a fs stat mode int
Expand Down

0 comments on commit 1e552d1

Please sign in to comment.