Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mafintosh/tar-fs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.1.0
Choose a base ref
...
head repository: mafintosh/tar-fs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.1.1
Choose a head ref
  • 6 commits
  • 5 files changed
  • 3 contributors

Commits on Nov 6, 2020

  1. Dependency bump for CVE-2020-8244 (#97)

    Upgrade to `tar-stream` version `2.1.4` so we can get `bl` version `4.0.3`.
    dchambers authored Nov 6, 2020

    Verified

    This commit was signed with the committer’s verified signature.
    renovate-bot Mend Renovate
    Copy the full SHA
    21cb738 View commit details
  2. update standard (#85)

    this repo is used in the standard test suite, so it helps if it uses the latest standard :)
    feross authored Nov 6, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    2b9eb7a View commit details
  3. add fix by @k13-engineering

    mafintosh committed Nov 6, 2020
    Copy the full SHA
    f80a770 View commit details
  4. more docs

    mafintosh committed Nov 6, 2020
    Copy the full SHA
    ac27bac View commit details
  5. bump travis

    mafintosh committed Nov 6, 2020
    Copy the full SHA
    207879d View commit details
  6. 2.1.1

    mafintosh committed Nov 6, 2020
    Copy the full SHA
    7ec11cb View commit details
Showing with 17 additions and 11 deletions.
  1. +2 −1 .travis.yml
  2. +2 −0 README.md
  3. +9 −6 index.js
  4. +3 −3 package.json
  5. +1 −1 test/index.js
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
language: node_js
node_js:
- 6
- 8
- 10
- 12
- 14
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -81,6 +81,8 @@ Similarly you can use `mapStream` incase you wanna modify the input/output file
``` js
var pack = tar.pack('./my-directory', {
mapStream: function(fileStream, header) {
// NOTE: the returned stream HAS to have the same length as the input stream.
// If not make sure to update the size in the header passed in here.
if (path.extname(header.name) === '.js') {
return fileStream.pipe(someTransform)
}
15 changes: 9 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ var statAll = function (fs, stat, cwd, ignore, entries, sort) {
var next = queue.shift()
var nextAbs = path.join(cwd, next)

stat(nextAbs, function (err, stat) {
stat.call(fs, nextAbs, function (err, stat) {
if (err) return callback(err)

if (!stat.isDirectory()) return callback(null, next, stat)
@@ -227,12 +227,15 @@ exports.extract = function (cwd, opts) {
if (!chmod) return cb()

var mode = (header.mode | (header.type === 'directory' ? dmode : fmode)) & umask
chmod(name, mode, function (err) {

if (chown && own) chown.call(xfs, name, header.uid, header.gid, onchown)
else onchown(null)

function onchown (err) {
if (err) return cb(err)
if (!own) return cb()
if (!chown) return cb()
chown(name, header.uid, header.gid, cb)
})
if (!chmod) return cb()
chmod.call(xfs, name, mode, cb)
}
}

extract.on('entry', function (header, stream, next) {
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "tar-fs",
"version": "2.1.0",
"version": "2.1.1",
"description": "filesystem bindings for tar-stream",
"dependencies": {
"chownr": "^1.1.1",
"mkdirp-classic": "^0.5.2",
"pump": "^3.0.0",
"tar-stream": "^2.0.0"
"tar-stream": "^2.1.4"
},
"keywords": [
"tar",
@@ -18,7 +18,7 @@
],
"devDependencies": {
"rimraf": "^2.6.3",
"standard": "^12.0.1",
"standard": "^13.0.1",
"tape": "^4.9.2"
},
"scripts": {
2 changes: 1 addition & 1 deletion test/index.js
Original file line number Diff line number Diff line change
@@ -197,7 +197,7 @@ test('specific entries', function (t) {
var a = path.join(__dirname, 'fixtures', 'd')
var b = path.join(__dirname, 'fixtures', 'copy', 'd-entries')

var entries = [ 'file1', 'sub-files/file3', 'sub-dir' ]
var entries = ['file1', 'sub-files/file3', 'sub-dir']

rimraf.sync(b)
tar.pack(a, { entries: entries })