Comparing version
16
index.js
@@ -275,9 +275,13 @@ var chownr = require('chownr') | ||
xfs.link(srcpath, name, function (err) { | ||
if (err && err.code === 'EPERM' && opts.hardlinkAsFilesFallback) { | ||
stream = xfs.createReadStream(srcpath) | ||
return onfile() | ||
} | ||
xfs.realpath(srcpath, function (err, dst) { | ||
if (err || !dst.startsWith(path.resolve(cwd))) return next(new Error(name + ' is not a valid hardlink')) | ||
stat(err) | ||
xfs.link(dst, name, function (err) { | ||
if (err && err.code === 'EPERM' && opts.hardlinkAsFilesFallback) { | ||
stream = xfs.createReadStream(srcpath) | ||
return onfile() | ||
} | ||
stat(err) | ||
}) | ||
}) | ||
@@ -284,0 +288,0 @@ }) |
{ | ||
"name": "tar-fs", | ||
"version": "2.1.2", | ||
"version": "2.1.3", | ||
"description": "filesystem bindings for tar-stream", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
28390
0.67%555
0.54%