Slightly rework installer to ask most questions on initial install.

This commit is contained in:
Buster "Silver Eagle" Neece 2021-07-09 17:59:30 -05:00
parent 4781040e8d
commit 079c9eedd3
No known key found for this signature in database
GPG Key ID: 6D9E12FF03411F4E
2 changed files with 12 additions and 10 deletions

View File

@ -18,5 +18,5 @@ $console->command(
new App\Installer\Command\InstallCommand($environment) new App\Installer\Command\InstallCommand($environment)
); );
$console->setDefaultCommand('install'); $console->setDefaultCommand('install', true);
$console->run(); $console->run();

View File

@ -52,7 +52,7 @@ class InstallCommand
} }
// Initialize locale for translated installer/updater. // Initialize locale for translated installer/updater.
if ($isNewInstall || empty($azuracastEnv[Environment::LANG])) { if (!$defaults && ($isNewInstall || empty($azuracastEnv[Environment::LANG]))) {
$langOptions = []; $langOptions = [];
foreach (Locale::SUPPORTED_LOCALES as $langKey => $langName) { foreach (Locale::SUPPORTED_LOCALES as $langKey => $langName) {
$langOptions[Locale::stripLocaleEncoding($langKey)] = $langName; $langOptions[Locale::stripLocaleEncoding($langKey)] = $langName;
@ -109,19 +109,21 @@ class InstallCommand
$io->block( $io->block(
__('Welcome to AzuraCast! Complete the initial server setup by answering a few questions.') __('Welcome to AzuraCast! Complete the initial server setup by answering a few questions.')
); );
$customize = !$defaults;
} else { } else {
$io->title( $io->title(
__('AzuraCast Updater') __('AzuraCast Updater')
); );
}
if ($defaults) { if ($defaults) {
$customize = false; $customize = false;
} else { } else {
$customize = $io->confirm( $customize = $io->confirm(
__('Customize server settings (ports, databases, etc.)?'), __('Change installation settings?'),
false false
); );
}
} }
if ($customize) { if ($customize) {