mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 08:58:35 +00:00
Fix envCommands set too late
This commit is contained in:
parent
80241e37c3
commit
313444cb12
1 changed files with 12 additions and 7 deletions
|
|
@ -869,22 +869,27 @@ class Builds extends Action
|
|||
} elseif ($resource->getCollection() === 'sites') {
|
||||
$commands = [];
|
||||
|
||||
$commands[] = $deployment->getAttribute('installCommand', '');
|
||||
$commands[] = $deployment->getAttribute('buildCommand', '');
|
||||
|
||||
$frameworks = Config::getParam('frameworks', []);
|
||||
$framework = $frameworks[$resource->getAttribute('framework', '')] ?? null;
|
||||
|
||||
$envCommand = '';
|
||||
$bundleCommand = '';
|
||||
|
||||
if (!is_null($framework)) {
|
||||
$adapter = ($framework['adapters'] ?? [])[$resource->getAttribute('adapter', '')] ?? null;
|
||||
if (!is_null($adapter) && isset($adapter['bundleCommand'])) {
|
||||
$commands[] = $adapter['bundleCommand'];
|
||||
}
|
||||
if (!is_null($adapter) && isset($adapter['envCommand'])) {
|
||||
$commands[] = $adapter['envCommand'];
|
||||
$envCommand = $adapter['envCommand'];
|
||||
}
|
||||
if (!is_null($adapter) && isset($adapter['bundleCommand'])) {
|
||||
$bundleCommand = $adapter['bundleCommand'];
|
||||
}
|
||||
}
|
||||
|
||||
$commands[] = $envCommand;
|
||||
$commands[] = $deployment->getAttribute('installCommand', '');
|
||||
$commands[] = $deployment->getAttribute('buildCommand', '');
|
||||
$commands[] = $bundleCommand;
|
||||
|
||||
$commands = array_filter($commands, fn ($command) => !empty($command));
|
||||
|
||||
return implode(' && ', $commands);
|
||||
|
|
|
|||
Loading…
Reference in a new issue