summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-x[-rw-r--r--]bin/rr16
1 files changed, 12 insertions, 4 deletions
diff --git a/bin/rr b/bin/rr
index 71670ff4..d0363601 100644..100755
--- a/bin/rr
+++ b/bin/rr
@@ -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;
+ }
}
}