diff options
-rwxr-xr-x | bin/rr | 11 | ||||
-rw-r--r-- | cmd/rr/cmd/root.go | 2 |
2 files changed, 9 insertions, 4 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; } } diff --git a/cmd/rr/cmd/root.go b/cmd/rr/cmd/root.go index 3c2cb8b0..d6929473 100644 --- a/cmd/rr/cmd/root.go +++ b/cmd/rr/cmd/root.go @@ -52,7 +52,7 @@ var ( SilenceErrors: true, SilenceUsage: true, Short: util.Sprintf( - "<green>RoadRunner</reset>, PHP Application Server\nVersion: %s, %s", + "<green>RoadRunner</reset>, PHP Application Server\nVersion: <yellow+hb>%s</reset>, %s", Version, BuildTime, ), |