Merge pull request #6141 from appwrite/fix-overwrite-executor-variable

Fix _APP_EXECUTOR_HOST for upgrades
This commit is contained in:
Christy Jacob
2023-09-05 19:35:31 -04:00
committed by GitHub
2 changed files with 11 additions and 9 deletions
+1
View File
@@ -750,6 +750,7 @@ return [
'introduction' => '0.13.0',
'default' => 'http://appwrite-executor/v1',
'required' => false,
'overwrite' => true,
'question' => '',
'filter' => ''
],
+10 -9
View File
@@ -40,6 +40,7 @@ class Install extends Action
$config = Config::getParam('variables');
$defaultHTTPPort = '80';
$defaultHTTPSPort = '443';
/** @var array<string, array<string, string>> $vars array whre key is variable name and value is variable */
$vars = [];
/**
@@ -50,7 +51,7 @@ class Install extends Action
foreach ($config as $category) {
foreach ($category['variables'] ?? [] as $var) {
$vars[] = $var;
$vars[$var['name']] = $var;
}
}
@@ -104,10 +105,10 @@ class Install extends Action
if (is_null($value)) {
continue;
}
foreach ($vars as $i => $var) {
if ($var['name'] === $key) {
$vars[$i]['default'] = $value;
}
$configVar = $vars[$key] ?? [];
if (!empty($configVar) && !($configVar['overwrite'] ?? false)) {
$vars[$key]['default'] = $value;
}
}
}
@@ -123,10 +124,10 @@ class Install extends Action
if (is_null($value)) {
continue;
}
foreach ($vars as $i => $var) {
if ($var['name'] === $key) {
$vars[$i]['default'] = $value;
}
$configVar = $vars[$key] ?? [];
if (!empty($configVar) && !($configVar['overwrite'] ?? false)) {
$vars[$key]['default'] = $value;
}
}
}