diff options
Diffstat (limited to 'bin/rr')
-rwxr-xr-x | bin/rr | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -198,17 +198,22 @@ class RRHelper if (is_file($finalFile)) { $version = RRHelper::getVersion(); - $previousVersion = shell_exec($finalFile . ' | awk \'/\'Version:\'/ { gsub(/[^[:digit:]\.]+/, "", $2); printf $2}\''); + $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'); 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)); + $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] '))) { + $question = new ConfirmationQuestion('Do you want overwrite it? [Y/n]'); + if (!$helper->ask($input, $output, $question)) { return; } } |