feat: add link module
test / test (push) Failing after 5m41s

This commit is contained in:
2026-11-02 02:35:24 +03:00
parent 7615dbfc48
commit 8fb9b90d6c
11 changed files with 158 additions and 130 deletions
+9 -3
View File
@@ -2,10 +2,13 @@ import os from "os";
import path from "path";
import download from "../common/download";
import { Logger } from "../common/log";
import { resolveLink, type Link } from "./link";
export class Sdk {
static _dir: string;
url!: string;
static set dir(value) {
Sdk._dir = value;
}
@@ -45,8 +48,11 @@ export class Sdk {
throw "Not implemented";
}
get link(): string {
throw "Not implemented";
get link(): string | Link {
return {
version: this.version,
url: this.url,
};
}
prepare(strip = 1): Promise<any> {
@@ -55,7 +61,7 @@ export class Sdk {
return Promise.resolve();
} else {
this.log.i("download: *%s*", this.link);
return download(this.link, this.path, { strip });
return download(resolveLink(this.link, this), this.path, { strip });
}
}
}