mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
update: check assistant status on upgrade as well.
This commit is contained in:
@@ -149,9 +149,28 @@ class Install extends Action
|
||||
}
|
||||
|
||||
$enableAssistant = false;
|
||||
$assistantExistsInOldCompose = false;
|
||||
|
||||
if ($data !== false && isset($compose)) {
|
||||
try {
|
||||
$assistantService = $compose->getService('appwrite-assistant');
|
||||
$assistantExistsInOldCompose = $assistantService !== null;
|
||||
} catch (\Throwable) {
|
||||
// assistant service doesn't exist, keep default false
|
||||
}
|
||||
}
|
||||
|
||||
if ($interactive == 'Y' && Console::isInteractive()) {
|
||||
$answer = Console::confirm('Add Appwrite Assistant? (Y/n)');
|
||||
$enableAssistant = !empty($answer) && \strtolower($answer) === 'y';
|
||||
$prompt = 'Add Appwrite Assistant? (Y/n)' . ($assistantExistsInOldCompose ? ' [Currently enabled]' : '');
|
||||
$answer = Console::confirm($prompt);
|
||||
|
||||
if (empty($answer)) {
|
||||
$enableAssistant = $assistantExistsInOldCompose;
|
||||
} else {
|
||||
$enableAssistant = \strtolower($answer) === 'y';
|
||||
}
|
||||
} elseif ($assistantExistsInOldCompose) {
|
||||
$enableAssistant = true;
|
||||
}
|
||||
|
||||
$input = [];
|
||||
|
||||
Reference in New Issue
Block a user