mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-12 19:35:35 +08:00
Use env and path injection instead of old style
This commit is contained in:
@@ -2,5 +2,11 @@ go-xcaddy:
|
|||||||
type: target
|
type: target
|
||||||
artifact:
|
artifact:
|
||||||
binary: custom
|
binary: custom
|
||||||
|
env:
|
||||||
|
GOROOT: '{pkg_root_path}/go-xcaddy'
|
||||||
|
GOBIN: '{pkg_root_path}/go-xcaddy/bin'
|
||||||
|
GOPATH: '{pkg_root_path}/go-xcaddy/go'
|
||||||
|
path@unix:
|
||||||
|
- '{pkg_root_path}/go-xcaddy/bin'
|
||||||
static-bins:
|
static-bins:
|
||||||
- xcaddy
|
- xcaddy
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Package\Target;
|
|
||||||
|
|
||||||
use StaticPHP\Attribute\Package\BeforeStage;
|
|
||||||
use StaticPHP\Attribute\Package\InitPackage;
|
|
||||||
use StaticPHP\Attribute\Package\Target;
|
|
||||||
use StaticPHP\Util\GlobalEnvManager;
|
|
||||||
|
|
||||||
#[Target('go-xcaddy')]
|
|
||||||
class go_xcaddy
|
|
||||||
{
|
|
||||||
#[InitPackage]
|
|
||||||
#[BeforeStage('frankenphp', 'build', 'go-xcaddy')]
|
|
||||||
public function init(): void
|
|
||||||
{
|
|
||||||
if (is_dir(PKG_ROOT_PATH . '/go-xcaddy/bin')) {
|
|
||||||
GlobalEnvManager::addPathIfNotExists(PKG_ROOT_PATH . '/go-xcaddy/bin');
|
|
||||||
GlobalEnvManager::putenv('GOROOT=' . PKG_ROOT_PATH . '/go-xcaddy');
|
|
||||||
GlobalEnvManager::putenv('GOBIN=' . PKG_ROOT_PATH . '/go-xcaddy/bin');
|
|
||||||
GlobalEnvManager::putenv('GOPATH=' . PKG_ROOT_PATH . '/go-xcaddy/go');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user