feat: add link module
test / test (push) Successful in 6m32s

This commit is contained in:
2026-11-05 23:43:28 +03:00
parent 7615dbfc48
commit 68bb39f09a
11 changed files with 165 additions and 130 deletions
+5 -15
View File
@@ -33,6 +33,11 @@ export class Haxe extends Sdk {
static buildDir = path.join(process.cwd(), "build");
url =
"https://github.com/HaxeFoundation/haxe/releases/download/" +
"<%= version %>/" +
"haxe-<%= version %>-<%= os_name %><%= os_arch %>.<%= os_archive_ext %>";
getBin(name: string) {
if (System.isWindows) {
return path.join(this.path, name + ".exe");
@@ -93,21 +98,6 @@ export class Haxe extends Sdk {
}
}
static buildLink(version: string): string {
if (System.isWindows) {
return `https://github.com/HaxeFoundation/haxe/releases/download/${version}/haxe-${version}-win.zip`;
} else if (System.isLinux) {
let arch = System.archInt;
return `https://github.com/HaxeFoundation/haxe/releases/download/${version}/haxe-${version}-linux${arch}.tar.gz`;
} else {
throw `Unsupported os: ${System.os}`;
}
}
get link(): string {
return Haxe.buildLink(this.version);
}
haxe(args: any) {
this.activate();
return exec(".", [this.haxeBin].concat(args).join(" "));