Skip to content

Commit

Permalink
fix: one more unarchive dedgecase
Browse files Browse the repository at this point in the history
  • Loading branch information
Yohe-Am committed Dec 11, 2023
1 parent 6848dee commit fc9473c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ghjk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ import whiz from "./ports/whiz.ts";
// installType: "version",
// });
// protoc({});
earthly({});
// ruff({});
// earthly({});
ruff({});
// whiz({});
12 changes: 10 additions & 2 deletions ports/ruff.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
$,
addInstallGlobal,
depBinShimPath,
DownloadArgs,
downloadFile,
GithubReleasePort,
Expand All @@ -11,14 +12,18 @@ import {
std_fs,
std_path,
std_url,
unarchive,
} from "../port.ts";
import * as std_ports from "../modules/ports/std.ts";

const manifest = {
ty: "denoWorker" as const,
name: "ruff@ghrel",
version: "0.1.0",
moduleSpecifier: import.meta.url,
deps: [
// we have to use tar because their tarballs for darwin use gnu sparse
std_ports.tar_aa,
],
};

registerDenoPortGlobal(manifest, () => new Port());
Expand Down Expand Up @@ -47,8 +52,11 @@ export class Port extends GithubReleasePort {
const fileName = std_url.basename(
artifactUrl(args.installVersion, args.platform),
);

const fileDwnPath = std_path.resolve(args.downloadPath, fileName);
await unarchive(fileDwnPath, args.tmpDirPath);
await $`${
depBinShimPath(std_ports.tar_aa, "tar", args.depShims)
} xf ${fileDwnPath} --directory=${args.tmpDirPath}`;

const installPath = $.path(args.installPath);
if (await installPath.exists()) {
Expand Down
1 change: 1 addition & 0 deletions utils/unarchive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {

/// Uses file extension to determine type
/// Does not support extracting symlinks
/// Does not support tarballs using [GnuSparse](https://www.gnu.org/software/tar/manual/html_node/Sparse-Recovery.html)
export async function unarchive(
path: string,
dest = "./",
Expand Down

0 comments on commit fc9473c

Please sign in to comment.