chore: resolve comment
This commit is contained in:
parent
3deea91193
commit
9e34256b2f
|
|
@ -11,10 +11,11 @@ export const isValidUrl = (input: string) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const downloadAndExtract = async (url: string): Promise<string> => new Promise((resolve, reject) => {
|
export const downloadAndExtract = async (url: string) =>
|
||||||
|
new Promise<string>((resolve, reject) => {
|
||||||
const destDir = `${tmpdir()}/chromium-pack`
|
const destDir = `${tmpdir()}/chromium-pack`
|
||||||
const extractObj = extract(destDir)
|
const extractObj = extract(destDir)
|
||||||
get(url, function (response) {
|
get(url, (response) => {
|
||||||
response.pipe(extractObj);
|
response.pipe(extractObj);
|
||||||
extractObj.on('finish', () => {
|
extractObj.on('finish', () => {
|
||||||
extractObj.end(() => {
|
extractObj.end(() => {
|
||||||
|
|
@ -26,4 +27,4 @@ export const downloadAndExtract = async (url: string): Promise<string> => new Pr
|
||||||
reject(err)
|
reject(err)
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue