From f3971d0d2e303a15ae83297012762fde54f863a8 Mon Sep 17 00:00:00 2001 From: Myh Date: Wed, 13 Jan 2021 11:26:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=8E=8B=E6=94=AF=E6=8C=81symlink?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 解压支持symlink类型 --- lib/utils.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/utils.js b/lib/utils.js index a7c4e91..b05f19c 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -118,7 +118,10 @@ exports.makeUncompressFn = StreamClass => { done(); }); }); - } else { // directory + } else if(header.type==='symlink'){ + const fullpath = path.join(destDir, header.name); + fs.symlinkSync(header.linkname,fullpath); + } else{ // directory mkdirp(path.join(destDir, header.name), err => { if (err) return reject(err); stream.resume();