Skip to content

Commit

Permalink
add capability to accept updates via command option (#4109)
Browse files Browse the repository at this point in the history
* 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 e6e3332
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/Command/Update/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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
);
Expand All @@ -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
);
Expand Down

0 comments on commit e6e3332

Please sign in to comment.