adjust craft command for zig

This commit is contained in:
DubbleClick
2025-06-28 22:55:30 +07:00
parent 9e9474a026
commit 02f2837f86
2 changed files with 18 additions and 9 deletions

View File

@@ -30,7 +30,11 @@ class Zig extends CustomPackage
default => "{$pkgroot}/{$name}/bin/zig",
};
if (file_exists($zig_exec) && !$force) {
if ($force) {
FileSystem::removeDir($pkgroot . '/' . $name);
}
if (file_exists($zig_exec)) {
return;
}
@@ -73,13 +77,13 @@ class Zig extends CustomPackage
$url = $download_info['tarball'];
$filename = basename($url);
$config = [
$pkg = [
'type' => 'url',
'url' => $url,
'filename' => $filename,
];
Downloader::downloadPackage($name, $config, $force);
Downloader::downloadPackage($name, $pkg, $force);
}
public function extract(string $name): void
@@ -91,11 +95,7 @@ class Zig extends CustomPackage
default => "{$zig_bin_dir}/zig",
};
if (file_exists($zig_exec)) {
if (!file_exists("{$zig_bin_dir}/zig-cc")) {
$this->createZigCcScript($zig_bin_dir);
return;
}
if (file_exists($zig_exec) && file_exists("{$zig_bin_dir}/zig-cc")) {
return;
}