mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
Add no-env-check for builder
This commit is contained in:
parent
e36800b951
commit
fcaa7c5f42
@ -29,7 +29,10 @@ class MacOSBuilder extends UnixBuilderBase
|
||||
|
||||
// apply global environment variables
|
||||
GlobalEnvManager::init();
|
||||
GlobalEnvManager::afterInit();
|
||||
|
||||
if (!$this->getOption('no-env-check')) {
|
||||
GlobalEnvManager::afterInit();
|
||||
}
|
||||
|
||||
// ---------- set necessary compile vars ----------
|
||||
// concurrency
|
||||
|
||||
@ -32,6 +32,7 @@ abstract class BaseCommand extends Command
|
||||
parent::__construct($name);
|
||||
$this->addOption('debug', null, null, 'Enable debug mode');
|
||||
$this->addOption('no-motd', null, null, 'Disable motd');
|
||||
$this->addOption('no-env-check', null, null, 'Disable env check for builder');
|
||||
}
|
||||
|
||||
public function initialize(InputInterface $input, OutputInterface $output): void
|
||||
@ -99,6 +100,7 @@ abstract class BaseCommand extends Command
|
||||
// init GlobalEnv
|
||||
if (!$this instanceof BuildCommand) {
|
||||
GlobalEnvManager::init();
|
||||
$this->input->setOption('no-env-check', true);
|
||||
}
|
||||
if ($this->shouldExecute()) {
|
||||
try {
|
||||
|
||||
@ -10,7 +10,7 @@ use Symfony\Component\Console\Attribute\AsCommand;
|
||||
use Symfony\Component\Process\Process;
|
||||
|
||||
#[AsCommand('craft', 'Build static-php from craft.yml')]
|
||||
class CraftCommand extends BaseCommand
|
||||
class CraftCommand extends BuildCommand
|
||||
{
|
||||
public function configure(): void
|
||||
{
|
||||
|
||||
@ -11,7 +11,7 @@ use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
|
||||
#[AsCommand('spc-config', 'Build dependencies')]
|
||||
class SPCConfigCommand extends BuildCommand
|
||||
class SPCConfigCommand extends BaseCommand
|
||||
{
|
||||
protected bool $no_motd = true;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user