Skip to content

Commit

Permalink
feat: remove decompress
Browse files Browse the repository at this point in the history
  • Loading branch information
Zxilly committed Feb 17, 2024
1 parent 2f5f8f2 commit 81f420c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zxilly/bin-wrapper",
"version": "1.0.2",
"version": "1.0.3",
"description": "Binary wrapper that makes your programs seamlessly available as local dependencies, now with TypeScript.",
"license": "MIT",
"repository": "Zxilly/bin-wrapper-ts",
Expand Down
2 changes: 1 addition & 1 deletion src/decompress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ async function decompressZip(filePath: string, targetPath: string, filter: (file
});
}

async function decompress(filePath: string, targetPath: string, filter: (filename: string, path: string) => boolean, strip: number): Promise<void> {
export async function decompress(filePath: string, targetPath: string, filter: (filename: string, path: string) => boolean, strip: number): Promise<void> {
const type = await fileTypeFromFile(filePath);

switch (type?.ext) {
Expand Down
4 changes: 2 additions & 2 deletions src/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import fs from "node:fs";
import {pipeline} from 'stream';
import {promisify} from 'util';
import {temporaryFileTask} from "tempy";
import decompress from "decompress";
import {decompress} from "./decompress";

const streamPipeline = promisify(pipeline);

Expand All @@ -18,6 +18,6 @@ export async function downloadAndExtract(url: string, target: string, prefix: st
await temporaryFileTask(async tempFile => {
await download(url, tempFile);


await decompress(tempFile, target, (filename) => filename.startsWith(prefix), strip);
})
}

0 comments on commit 81f420c

Please sign in to comment.