From 20e3298c1dd8e340b9f0c883814f89365942d472 Mon Sep 17 00:00:00 2001 From: SukkaW Date: Fri, 28 Feb 2025 14:16:36 +0800 Subject: [PATCH] Minor Changes --- Build/download-previous-build.ts | 47 +++++++++++++++----------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/Build/download-previous-build.ts b/Build/download-previous-build.ts index 8080c5bb..eeecfcc6 100644 --- a/Build/download-previous-build.ts +++ b/Build/download-previous-build.ts @@ -66,33 +66,30 @@ export const downloadPreviousBuild = task(require.main === module, __filename)(a const pathPrefix = 'ruleset.skk.moe-master/'; - const gunzip = zlib.createGunzip(); - const extract = tarExtract( - PUBLIC_DIR, - { - ignore(_: string, header?: TarEntryHeaders) { - if (header) { - if (header.type !== 'file' && header.type !== 'directory') { - return true; - } - if (header.type === 'file' && path.extname(header.name) === '.ts') { - return true; - } - } - - return false; - }, - map(header) { - header.name = header.name.replace(pathPrefix, ''); - return header; - } - } - ); - return pipeline( respBody, - gunzip, - extract + zlib.createGunzip(), + tarExtract( + PUBLIC_DIR, + { + ignore(_: string, header?: TarEntryHeaders) { + if (header) { + if (header.type !== 'file' && header.type !== 'directory') { + return true; + } + if (header.type === 'file' && path.extname(header.name) === '.ts') { + return true; + } + } + + return false; + }, + map(header) { + header.name = header.name.replace(pathPrefix, ''); + return header; + } + } + ) ); }); });