This repository has been archived by the owner on Sep 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(install): update targz lib to fix crash extracting versions (#951)
* chore: update dev dependencies * chore: update webpack to v5
- Loading branch information
Noah
authored
Mar 13, 2021
1 parent
467d146
commit 79e8a6e
Showing
7 changed files
with
932 additions
and
1,962 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import zlib from 'zlib' | ||
import fs from 'fs' | ||
|
||
import tar from 'tar-fs' | ||
|
||
export const extract = async ({ src, dest }) => | ||
await new Promise((resolve, reject) => { | ||
fs.createReadStream(src) | ||
.on('error', reject) | ||
.pipe( | ||
zlib | ||
.createGunzip({}) | ||
.on('error', () => | ||
reject(new Error('Unable to decompress.')), | ||
), | ||
) | ||
.pipe( | ||
tar | ||
.extract(dest, {}) | ||
.on('error', () => reject(new Error('Unable to extract.'))) | ||
.on('finish', () => resolve(dest)), | ||
) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.