mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-08 09:25:35 +08:00
Add getSourceRoot for artifacts
This commit is contained in:
@@ -268,6 +268,19 @@ class Artifact
|
||||
return FileSystem::convertPath(SOURCE_PATH . '/' . $path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get source build root directory.
|
||||
* It's only worked when 'source-root' is defined in artifact config.
|
||||
* Normally it's equal to source dir.
|
||||
*/
|
||||
public function getSourceRoot(): string
|
||||
{
|
||||
if (isset($this->config['metadata']['source-root'])) {
|
||||
return $this->getSourceDir() . '/' . ltrim($this->config['metadata']['source-root'], '/');
|
||||
}
|
||||
return $this->getSourceDir();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get binary extraction directory and mode.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user