Prefer cache extract path in getSourceDir method

This commit is contained in:
crazywhalecc 2026-03-08 14:00:33 +08:00
parent b0b3220716
commit 88af4a719f
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680

View File

@ -292,8 +292,11 @@ class Artifact
*/
public function getSourceDir(): string
{
// defined in config
$extract = $this->config['source']['extract'] ?? null;
// Prefer cache extract path, fall back to config
$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) {
return FileSystem::convertPath(SOURCE_PATH . '/' . $this->name);