mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-06 00:05:42 +08:00
refactor env var logic out to packages, abomination of a zig-cc script...
This commit is contained in:
@@ -7,6 +7,7 @@ namespace SPC\util;
|
||||
use SPC\builder\linux\SystemUtil;
|
||||
use SPC\exception\RuntimeException;
|
||||
use SPC\exception\WrongUsageException;
|
||||
use SPC\store\pkg\Zig;
|
||||
|
||||
/**
|
||||
* Environment variable manager
|
||||
@@ -100,6 +101,14 @@ class GlobalEnvManager
|
||||
self::putenv("{$k}={$v}");
|
||||
}
|
||||
}
|
||||
if (str_contains(getenv('CC'), 'zig') || str_contains(getenv('CXX'), 'zig')) {
|
||||
$zigEnv = Zig::getEnvironment();
|
||||
foreach ($zigEnv as $key => $value) {
|
||||
if ($key === 'PATH') {
|
||||
self::addPathIfNotExists($value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function putenv(string $val): void
|
||||
|
||||
Reference in New Issue
Block a user