diff options
Diffstat (limited to 'bin')
-rwxr-xr-x[-rw-r--r--] | bin/rr | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -197,12 +197,20 @@ class RRHelper } if (is_file($finalFile)) { + $version = RRHelper::getVersion(); + $previousVersion = shell_exec($finalFile . ' | awk \'/\'Version:\'/ { gsub(/[^[:digit:]\.]+/, "", $2); printf $2}\''); $output->writeln('<error>RoadRunner binary file already exists!</error>'); $helper = $this->getHelper('question'); - $question = new ConfirmationQuestion('Do you want overwrite it? [Y/n] '); - - if (!$helper->ask($input, $output, $question)) { - return; + if (version_compare($previousVersion, $version) === 0) { + $output->writeln(sprintf('<info>Current version: %s</info>', $previousVersion)); + $question = new ConfirmationQuestion(sprintf('Skip update to the same version: %s ? [Y/n]', $version)); + if ($helper->ask($input, $output, $question)) { + return; + } + } else { + if (!$helper->ask($input, $output, new ConfirmationQuestion('Do you want overwrite it? [Y/n] '))) { + return; + } } } |