Skip to content

Commit 893ce31

Browse files
committed
only install pkgs for crafting when necessary
1 parent 5c1194e commit 893ce31

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/SPC/command/CraftCommand.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
namespace SPC\command;
66

77
use SPC\exception\ValidationException;
8+
use SPC\store\pkg\GoXcaddy;
9+
use SPC\store\pkg\Zig;
810
use SPC\toolchain\ToolchainManager;
911
use SPC\toolchain\ZigToolchain;
1012
use SPC\util\ConfigValidator;
@@ -63,15 +65,15 @@ public function handle(): int
6365
}
6466
}
6567
// install go and xcaddy for frankenphp
66-
if (in_array('frankenphp', $craft['sapi'])) {
68+
if (in_array('frankenphp', $craft['sapi']) && !GoXcaddy::isInstalled()) {
6769
$retcode = $this->runCommand('install-pkg', 'go-xcaddy');
6870
if ($retcode !== 0) {
6971
$this->output->writeln('<error>craft go-xcaddy failed</error>');
7072
return static::FAILURE;
7173
}
7274
}
7375
// install zig if requested
74-
if (ToolchainManager::getToolchainClass() === ZigToolchain::class) {
76+
if (ToolchainManager::getToolchainClass() === ZigToolchain::class && !Zig::isInstalled()) {
7577
$retcode = $this->runCommand('install-pkg', 'zig');
7678
if ($retcode !== 0) {
7779
$this->output->writeln('<error>craft zig failed</error>');

0 commit comments

Comments
 (0)