mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-10 10:25:36 +08:00
Prefer cache extract path in getSourceDir method
This commit is contained in:
@@ -292,8 +292,11 @@ class Artifact
|
|||||||
*/
|
*/
|
||||||
public function getSourceDir(): string
|
public function getSourceDir(): string
|
||||||
{
|
{
|
||||||
// defined in config
|
// Prefer cache extract path, fall back to config
|
||||||
$extract = $this->config['source']['extract'] ?? null;
|
$cache_info = ApplicationContext::get(ArtifactCache::class)->getSourceInfo($this->name);
|
||||||
|
$extract = is_string($cache_info['extract'] ?? null)
|
||||||
|
? $cache_info['extract']
|
||||||
|
: ($this->config['source']['extract'] ?? null);
|
||||||
|
|
||||||
if ($extract === null) {
|
if ($extract === null) {
|
||||||
return FileSystem::convertPath(SOURCE_PATH . '/' . $this->name);
|
return FileSystem::convertPath(SOURCE_PATH . '/' . $this->name);
|
||||||
|
|||||||
Reference in New Issue
Block a user