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) => {
|
get(url, (response) => {
|
||||||
response.pipe(extractObj);
|
response.pipe(extractObj);
|
||||||
extractObj.on('finish', () => {
|
extractObj.on('finish', () => {
|
||||||
extractObj.end(() => {
|
|
||||||
resolve(destDir);
|
resolve(destDir);
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}).on('error', (err) => {
|
}).on('error', (err) => {
|
||||||
unlink(destDir, (_) => {
|
unlink(destDir, (_) => {
|
||||||
reject(err)
|
reject(err)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue