提交 74b82369 编写于 作者: X xzper 提交者: Joao Moreno

Fix extract when fileName is a directory

上级 6baaf13f
......@@ -38,6 +38,11 @@ function extractEntry(stream: Readable, fileName: string, mode: number, targetPa
const dirName = path.dirname(fileName);
const targetDirName = path.join(targetPath, dirName);
const targetFileName = path.join(targetPath, fileName);
// directory file names end with '/'
if (/\/$/.test(fileName)) {
return mkdirp(targetFileName);
}
return mkdirp(targetDirName).then(() => new Promise((c, e) => {
let istream = createWriteStream(targetFileName, { mode });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册