mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Ensured asking for previous shlink path is a mandatory question when updating shlink
This commit is contained in:
parent
757cf2e193
commit
d5736756f7
@ -8,6 +8,7 @@ use Psr\Container\NotFoundExceptionInterface;
|
|||||||
use Shlinkio\Shlink\Installer\Config\ConfigCustomizerManagerInterface;
|
use Shlinkio\Shlink\Installer\Config\ConfigCustomizerManagerInterface;
|
||||||
use Shlinkio\Shlink\Installer\Config\Plugin;
|
use Shlinkio\Shlink\Installer\Config\Plugin;
|
||||||
use Shlinkio\Shlink\Installer\Model\CustomizableAppConfig;
|
use Shlinkio\Shlink\Installer\Model\CustomizableAppConfig;
|
||||||
|
use Shlinkio\Shlink\Installer\Util\AskUtilsTrait;
|
||||||
use Symfony\Component\Console\Command\Command;
|
use Symfony\Component\Console\Command\Command;
|
||||||
use Symfony\Component\Console\Exception\InvalidArgumentException;
|
use Symfony\Component\Console\Exception\InvalidArgumentException;
|
||||||
use Symfony\Component\Console\Exception\LogicException;
|
use Symfony\Component\Console\Exception\LogicException;
|
||||||
@ -23,6 +24,8 @@ use Zend\Config\Writer\WriterInterface;
|
|||||||
|
|
||||||
class InstallCommand extends Command
|
class InstallCommand extends Command
|
||||||
{
|
{
|
||||||
|
use AskUtilsTrait;
|
||||||
|
|
||||||
public const GENERATED_CONFIG_PATH = 'config/params/generated_config.php';
|
public const GENERATED_CONFIG_PATH = 'config/params/generated_config.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -194,7 +197,9 @@ class InstallCommand extends Command
|
|||||||
// Ask the user for the older shlink path
|
// Ask the user for the older shlink path
|
||||||
$keepAsking = true;
|
$keepAsking = true;
|
||||||
do {
|
do {
|
||||||
$config->setImportedInstallationPath($this->io->ask(
|
$config->setImportedInstallationPath($this->askRequired(
|
||||||
|
$this->io,
|
||||||
|
'previous installation path',
|
||||||
'Previous shlink installation path from which to import config'
|
'Previous shlink installation path from which to import config'
|
||||||
));
|
));
|
||||||
$configFile = $config->getImportedInstallationPath() . '/' . self::GENERATED_CONFIG_PATH;
|
$configFile = $config->getImportedInstallationPath() . '/' . self::GENERATED_CONFIG_PATH;
|
||||||
|
@ -17,6 +17,8 @@ trait AskUtilsTrait
|
|||||||
if (empty($value)) {
|
if (empty($value)) {
|
||||||
throw MissingRequiredOptionException::fromOption($optionName);
|
throw MissingRequiredOptionException::fromOption($optionName);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
return $value;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user