Skip to content

Commit 74b8236

Browse files
f111feijoaomoreno
authored andcommitted
Fix extract when fileName is a directory
1 parent 6baaf13 commit 74b8236

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/vs/base/node/zip.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ function extractEntry(stream: Readable, fileName: string, mode: number, targetPa
3838
const dirName = path.dirname(fileName);
3939
const targetDirName = path.join(targetPath, dirName);
4040
const targetFileName = path.join(targetPath, fileName);
41+
42+
// directory file names end with '/'
43+
if (/\/$/.test(fileName)) {
44+
return mkdirp(targetFileName);
45+
}
4146

4247
return mkdirp(targetDirName).then(() => new Promise((c, e) => {
4348
let istream = createWriteStream(targetFileName, { mode });

0 commit comments

Comments
 (0)