mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-05 15:55:39 +08:00
Merge branch 'main' into frankenphp/mbed
This commit is contained in:
@@ -223,11 +223,9 @@ class BuildPHPCommand extends BuildCommand
|
||||
|
||||
// ---------- When using bin/spc-alpine-docker, the build root path is different from the host system ----------
|
||||
$build_root_path = BUILD_ROOT_PATH;
|
||||
$cwd = getcwd();
|
||||
$fixed = '';
|
||||
$build_root_path = get_display_path($build_root_path);
|
||||
if (!empty(getenv('SPC_FIX_DEPLOY_ROOT'))) {
|
||||
str_replace($cwd, '', $build_root_path);
|
||||
$build_root_path = getenv('SPC_FIX_DEPLOY_ROOT') . '/' . basename($build_root_path);
|
||||
$fixed = ' (host system)';
|
||||
}
|
||||
if (($rule & BUILD_TARGET_CLI) === BUILD_TARGET_CLI) {
|
||||
|
||||
@@ -5,6 +5,8 @@ declare(strict_types=1);
|
||||
namespace SPC\command;
|
||||
|
||||
use SPC\exception\ValidationException;
|
||||
use SPC\store\pkg\GoXcaddy;
|
||||
use SPC\store\pkg\Zig;
|
||||
use SPC\toolchain\ToolchainManager;
|
||||
use SPC\toolchain\ZigToolchain;
|
||||
use SPC\util\ConfigValidator;
|
||||
@@ -63,7 +65,7 @@ class CraftCommand extends BuildCommand
|
||||
}
|
||||
}
|
||||
// install go and xcaddy for frankenphp
|
||||
if (in_array('frankenphp', $craft['sapi'])) {
|
||||
if (in_array('frankenphp', $craft['sapi']) && !GoXcaddy::isInstalled()) {
|
||||
$retcode = $this->runCommand('install-pkg', 'go-xcaddy');
|
||||
if ($retcode !== 0) {
|
||||
$this->output->writeln('<error>craft go-xcaddy failed</error>');
|
||||
@@ -71,7 +73,7 @@ class CraftCommand extends BuildCommand
|
||||
}
|
||||
}
|
||||
// install zig if requested
|
||||
if (ToolchainManager::getToolchainClass() === ZigToolchain::class) {
|
||||
if (ToolchainManager::getToolchainClass() === ZigToolchain::class && !Zig::isInstalled()) {
|
||||
$retcode = $this->runCommand('install-pkg', 'zig');
|
||||
if ($retcode !== 0) {
|
||||
$this->output->writeln('<error>craft zig failed</error>');
|
||||
|
||||
@@ -106,7 +106,7 @@ class DownloadCommand extends BaseCommand
|
||||
}
|
||||
|
||||
// retry
|
||||
$retry = intval($this->getOption('retry'));
|
||||
$retry = (int) $this->getOption('retry');
|
||||
f_putenv('SPC_DOWNLOAD_RETRIES=' . $retry);
|
||||
|
||||
// Use shallow-clone can reduce git resource download
|
||||
@@ -265,7 +265,7 @@ class DownloadCommand extends BaseCommand
|
||||
f_passthru((PHP_OS_FAMILY === 'Windows' ? 'rmdir /s /q ' : 'rm -rf ') . DOWNLOAD_PATH);
|
||||
}
|
||||
// unzip command check
|
||||
if (PHP_OS_FAMILY !== 'Windows' && !$this->findCommand('unzip')) {
|
||||
if (PHP_OS_FAMILY !== 'Windows' && !self::findCommand('unzip')) {
|
||||
$this->output->writeln('Missing unzip command, you need to install it first !');
|
||||
$this->output->writeln('You can use "bin/spc doctor" command to check and install required tools');
|
||||
return static::FAILURE;
|
||||
|
||||
Reference in New Issue
Block a user