Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc5e7d96

Browse files
committed
hardlink tweak from main
1 parentff6510d commitc5e7d96

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

‎index.js‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -265,13 +265,17 @@ exports.extract = function (cwd, opts) {
265265
xfs.unlink(name,function(){
266266
varsrcpath=path.join(cwd,path.join('/',header.linkname))
267267

268-
xfs.link(srcpath,name,function(err){
269-
if(err&&err.code==='EPERM'&&opts.hardlinkAsFilesFallback){
270-
stream=xfs.createReadStream(srcpath)
271-
returnonfile()
272-
}
268+
xfs.realpath(srcpath,function(err,dst){
269+
if(err||!dst.startsWith(path.resolve(cwd)))returnnext(newError(name+' is not a valid hardlink'))
273270

274-
stat(err)
271+
xfs.link(dst,name,function(err){
272+
if(err&&err.code==='EPERM'&&opts.hardlinkAsFilesFallback){
273+
stream=xfs.createReadStream(srcpath)
274+
returnonfile()
275+
}
276+
277+
stat(err)
278+
})
275279
})
276280
})
277281
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp