diff options
author | Dmitri Gopkalo <[email protected]> | 2019-08-09 00:07:46 +0300 |
---|---|---|
committer | Dmitri Gopkalo <[email protected]> | 2019-08-09 01:36:34 +0300 |
commit | b512dd6ba4f8b809bba797ed9260b78f2ffe6822 (patch) | |
tree | 63380c4cb1f9dbb4d0ce3a9581c9d337717597e8 /bin | |
parent | 97d6b6b0d52918ef253e7cb65e50e7b51f4fe28d (diff) |
- add ability get-binary command to skip the same version downloading
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; + } } } |