Skip to content

Commit bce232f

Browse files
committed
bump script: fix display of version in bump commit
With -v flag specified without a version, the script would display the commit message without the version number, i.e. 'Bump version to '. Set the new version to framework version in this case.
1 parent 3c30d6d commit bce232f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/bump-version.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,17 +118,19 @@ function plugin_get_version( $p_basename ) {
118118
* @return void
119119
*/
120120
function bump_version_and_commit( $p_version, &$p_framework_version ) {
121-
global $g_plugins;
121+
global $g_plugins;
122122
$t_filename = 'Source/MantisSourceBase.class.php';
123123

124124
// Check if framework version needs to be updated
125+
$t_new_version = $p_framework_version;
125126
if( $p_version ) {
126127
echo "New version '$p_version' specified; ";
127128
if( $p_version == $p_framework_version ) {
128129
echo "framework already at";
129130
$p_version = false;
130131
} else {
131132
echo "bump from";
133+
$t_new_version = $p_version;
132134
}
133135
} else {
134136
echo "Unspecified version bump; framework at";
@@ -144,7 +146,7 @@ function bump_version_and_commit( $p_version, &$p_framework_version ) {
144146
}
145147

146148
// Generate commit message
147-
$t_message = "Bump version to $p_version\n\n";
149+
$t_message = "Bump version to $t_new_version\n\n";
148150
$t_message .= "VCS plugins changes:\n";
149151
foreach( get_changed_plugins() as $t_plugin ) {
150152
$t_message .= "- $t_plugin " . $g_plugins[$t_plugin] . "\n";

0 commit comments

Comments
 (0)