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();
} }
if(isset($argv[3])){
$nextVer = new VersionString($argv[3]);
}else{
$nextVer = new VersionString(sprintf( $nextVer = new VersionString(sprintf(
"%u.%u.%u", "%u.%u.%u",
$currentVer->getMajor(), $currentVer->getMajor(),
$currentVer->getMinor(), $currentVer->getMinor(),
$currentVer->getPatch() + 1 $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);