Skip to content

Commit

Permalink
Fix pipeline promise that never resolves on Node 14
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Apr 24, 2020
1 parent eb3c1ed commit aa173a4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@ class Extractor {
debug('creating symlink', link, dest)
await fs.symlink(link, dest)
} else {
await pipeline(readStream, createWriteStream(dest, { mode: procMode }))
await Promise.race([
pipeline(readStream, createWriteStream(dest, { mode: procMode })),
new Promise((resolve) => readStream.on('end', resolve))
])
}
}

Expand Down

0 comments on commit aa173a4

Please sign in to comment.