make-release: allow specifying the nextVer as well as currentVer

This commit is contained in:
Dylan K. Taylor 2021-09-05 15:29:55 +01:00
parent e1b7bf31bb
commit 92f3a7d206
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -66,7 +66,7 @@ function replaceVersion(string $versionInfoPath, string $newVersion, bool $isDev
*/ */
function main(array $argv) : void{ function main(array $argv) : void{
if(count($argv) < 2){ if(count($argv) < 2){
fwrite(STDERR, "Arguments: <channel> [release version]\n"); fwrite(STDERR, "Arguments: <channel> [release version] [next version]\n");
exit(1); exit(1);
} }
if(isset($argv[2])){ if(isset($argv[2])){
@ -74,12 +74,16 @@ function main(array $argv) : void{
}else{ }else{
$currentVer = VersionInfo::VERSION(); $currentVer = VersionInfo::VERSION();
} }
$nextVer = new VersionString(sprintf( if(isset($argv[3])){
"%u.%u.%u", $nextVer = new VersionString($argv[3]);
$currentVer->getMajor(), }else{
$currentVer->getMinor(), $nextVer = new VersionString(sprintf(
$currentVer->getPatch() + 1 "%u.%u.%u",
)); $currentVer->getMajor(),
$currentVer->getMinor(),
$currentVer->getPatch() + 1
));
}
echo "please add appropriate notes to the changelog and press enter..."; echo "please add appropriate notes to the changelog and press enter...";
fgets(STDIN); fgets(STDIN);