mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-28 17:41:54 +08:00
Minor changes to previous build downloading
This commit is contained in:
@@ -61,10 +61,11 @@ export const downloadPreviousBuild = task(import.meta.path, async (span) => {
|
||||
throw new Error('Download previous build failed! No body found');
|
||||
}
|
||||
|
||||
const extract = tarStream.extract();
|
||||
const gunzip = zlib.createGunzip();
|
||||
const extract = tarStream.extract();
|
||||
|
||||
pipeline(
|
||||
Readable.fromWeb(resp.body) as any,
|
||||
Readable.fromWeb(resp.body as unknown as import('stream/web').ReadableStream<any>),
|
||||
gunzip,
|
||||
extract
|
||||
);
|
||||
@@ -86,10 +87,7 @@ export const downloadPreviousBuild = task(import.meta.path, async (span) => {
|
||||
const targetPath = path.join(import.meta.dir, '..', relativeEntryPath);
|
||||
|
||||
await mkdir(path.dirname(targetPath), { recursive: true });
|
||||
await pipeline(
|
||||
entry as any,
|
||||
createWriteStream(targetPath)
|
||||
);
|
||||
await pipeline(entry, createWriteStream(targetPath));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user