File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -495,8 +495,9 @@ Archiver.prototype._updateQueueTaskWithStats = function(task, stats) {
495495 task . source = new Buffer ( 0 ) ;
496496 } else if ( stats . isSymbolicLink ( ) && this . _moduleSupports ( 'symlink' ) ) {
497497 var linkPath = fs . readlinkSync ( task . filepath ) ;
498+ var dirName = path . dirname ( task . filepath ) ;
498499 task . data . type = 'symlink' ;
499- task . data . linkname = path . relative ( path . dirname ( task . filepath ) , path . resolve ( linkPath ) ) ;
500+ task . data . linkname = path . relative ( dirName , path . resolve ( dirName , linkPath ) ) ;
500501 task . data . sourceType = 'buffer' ;
501502 task . source = new Buffer ( 0 ) ;
502503 } else {
Original file line number Diff line number Diff line change @@ -23,8 +23,8 @@ describe('plugins', function() {
2323 if ( ! win32 ) {
2424 fs . chmodSync ( 'test/fixtures/executable.sh' , 0777 ) ;
2525 fs . chmodSync ( 'test/fixtures/directory/subdir/' , 0755 ) ;
26- fs . symlinkSync ( 'test/fixtures/directory /level0.txt' , 'test/fixtures/directory/subdir/level0link.txt' ) ;
27- fs . symlinkSync ( 'test/fixtures/directory/subdir/ subsub/' , 'test/fixtures/directory/subdir/subsublink' ) ;
26+ fs . symlinkSync ( '.. /level0.txt' , 'test/fixtures/directory/subdir/level0link.txt' ) ;
27+ fs . symlinkSync ( 'subsub/' , 'test/fixtures/directory/subdir/subsublink' ) ;
2828 } else {
2929 fs . writeFileSync ( 'test/fixtures/directory/subdir/level0link.txt' , '../level0.txt' ) ;
3030 fs . writeFileSync ( 'test/fixtures/directory/subdir/subsublink' , 'subsub' ) ;
You can’t perform that action at this time.
0 commit comments