Skip to content
Permalink
Browse files

add capability to accept updates via command option (#4109)

* add capability to accept updates via command option

* remove dead code

* [update:execute] fix typo
  • Loading branch information...
lalop authored and enzolutions committed Jul 15, 2019
1 parent fca9572 commit e6e3332ef14aaa9434f28e97544549e52b9448b4
Showing with 3 additions and 6 deletions.
  1. +3 −6 src/Command/Update/ExecuteCommand.php
@@ -131,12 +131,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
$start = $this->getUpdates($this->module!=='all'?$this->module:null);
$updates = update_resolve_dependencies($start);
$dependencyMap = [];
$allowUpdate = false;
$assumeYes = $input->getOption('yes');
foreach ($updates as $function => $update) {
$dependencyMap[$function] = !empty($update['reverse_paths']) ? array_keys($update['reverse_paths']) : [];
}
if (!$this->checkUpdates($start, $updates)) {
if ($this->module === 'all') {
$this->getIo()->info(
@@ -161,7 +158,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$updateList = update_get_update_list();
$this->showUpdateTable($this->module === 'all' ? $updateList: $updateList[$this->module], $this->trans('commands.update.execute.messages.pending-updates'));
$allowUpdate = $this->getIo()->confirm(
$allowUpdate = $assumeYes || $this->getIo()->confirm(
$this->trans('commands.update.execute.questions.update'),
true
);
@@ -175,7 +172,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
);
} else {
$this->showPostUpdateTable($postUpdates, $this->trans('commands.update.execute.messages.pending-post-updates'));
$allowPostUpdate = $this->getIo()->confirm(
$allowPostUpdate = $assumeYes || $this->getIo()->confirm(
$this->trans('commands.update.execute.questions.post-update'),
true
);

0 comments on commit e6e3332

Please sign in to comment.
You can’t perform that action at this time.