1
0
Fork 0

[#2492] Prefixed real versions with ~ when guessing the latest version

2.1.0 > ~2.1.0
v2.1.0 -> ~2.1.0
dev-master -> dev-master
pull/3096/head
Ryan Weaver 2014-07-05 14:09:03 -05:00
parent 58535a62fa
commit 26179cc4b4
1 changed files with 11 additions and 1 deletions

View File

@ -349,7 +349,17 @@ EOT
));
}
$requirement['version'] = $package->getPrettyVersion();
$version = $package->getPrettyVersion();
if (!$package->isDev()) {
// remove the v prefix if there is one
if (substr($version, 0, 1) == 'v') {
$version = substr($version, 1);
}
// 2.1.0 -> ~2.1.0, 2.0-beta.1 -> ~2.0-beta.1
$version = '~'.$version;
}
$requirement['version'] = $version;
$output->writeln(sprintf(
'Using version <info>%s</info> for <info>%s</info>',