Browse Source

Minor Changes

SukkaW 1 year ago
parent
commit
20e3298c1d
1 changed files with 21 additions and 24 deletions
  1. 21 24
      Build/download-previous-build.ts

+ 21 - 24
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 pipeline(
+      respBody,
+      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;
+            return false;
+          },
+          map(header) {
+            header.name = header.name.replace(pathPrefix, '');
+            return header;
+          }
         }
-      }
-    );
-
-    return pipeline(
-      respBody,
-      gunzip,
-      extract
+      )
     );
   });
 });