Fix downloadAndExtract to resolve on finish
This commit is contained in:
parent
9e34256b2f
commit
083fd747ff
|
|
@ -18,10 +18,8 @@ export const downloadAndExtract = async (url: string) =>
|
|||
get(url, (response) => {
|
||||
response.pipe(extractObj);
|
||||
extractObj.on('finish', () => {
|
||||
extractObj.end(() => {
|
||||
resolve(destDir);
|
||||
});
|
||||
});
|
||||
}).on('error', (err) => {
|
||||
unlink(destDir, (_) => {
|
||||
reject(err)
|
||||
|
|
|
|||
Loading…
Reference in New Issue