Skip to content

Commit fcaa7c5

Browse files
committed
Add no-env-check for builder
1 parent e36800b commit fcaa7c5

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

src/SPC/builder/macos/MacOSBuilder.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ public function __construct(array $options = [])
2929

3030
// apply global environment variables
3131
GlobalEnvManager::init();
32-
GlobalEnvManager::afterInit();
32+
33+
if (!$this->getOption('no-env-check')) {
34+
GlobalEnvManager::afterInit();
35+
}
3336

3437
// ---------- set necessary compile vars ----------
3538
// concurrency

src/SPC/command/BaseCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public function __construct(?string $name = null)
3232
parent::__construct($name);
3333
$this->addOption('debug', null, null, 'Enable debug mode');
3434
$this->addOption('no-motd', null, null, 'Disable motd');
35+
$this->addOption('no-env-check', null, null, 'Disable env check for builder');
3536
}
3637

3738
public function initialize(InputInterface $input, OutputInterface $output): void
@@ -99,6 +100,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
99100
// init GlobalEnv
100101
if (!$this instanceof BuildCommand) {
101102
GlobalEnvManager::init();
103+
$this->input->setOption('no-env-check', true);
102104
}
103105
if ($this->shouldExecute()) {
104106
try {

src/SPC/command/CraftCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use Symfony\Component\Process\Process;
1111

1212
#[AsCommand('craft', 'Build static-php from craft.yml')]
13-
class CraftCommand extends BaseCommand
13+
class CraftCommand extends BuildCommand
1414
{
1515
public function configure(): void
1616
{

src/SPC/command/SPCConfigCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Symfony\Component\Console\Input\InputOption;
1212

1313
#[AsCommand('spc-config', 'Build dependencies')]
14-
class SPCConfigCommand extends BuildCommand
14+
class SPCConfigCommand extends BaseCommand
1515
{
1616
protected bool $no_motd = true;
1717

0 commit comments

Comments
 (0)