summaryrefslogtreecommitdiff
path: root/bin/rr
diff options
context:
space:
mode:
Diffstat (limited to 'bin/rr')
-rwxr-xr-x[-rw-r--r--]bin/rr21
1 files changed, 17 insertions, 4 deletions
diff --git a/bin/rr b/bin/rr
index 71670ff4..b62a9851 100644..100755
--- a/bin/rr
+++ b/bin/rr
@@ -197,12 +197,25 @@ class RRHelper
}
if (is_file($finalFile)) {
+ $version = RRHelper::getVersion();
+ $previousVersion =
+ preg_match('#Version:.+(\d+\.\d+\.\d+)#', (string)shell_exec($finalFile), $mathes) ?
+ $mathes[1] : "";
$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 {
+ $question = new ConfirmationQuestion('Do you want overwrite it? [Y/n]');
+ if (!$helper->ask($input, $output, $question)) {
+ return;
+ }
}
}