askForVersion function
Ask the user to select the new version no.
Pass in the current currentVersion
number.
Implementation
Version? askForVersion(Version currentVersion) {
final options = <_NewVersion>[
_NewVersion('Small Patch'.padRight(25), currentVersion.nextPatch),
_NewVersion('Non-breaking change'.padRight(25), currentVersion.nextMinor),
_NewVersion('Breaking change'.padRight(25), currentVersion.nextBreaking),
_NewVersion('Keep the current Version'.padRight(25), currentVersion),
_CustomVersion('Enter custom version no.'.padRight(25))
];
print('');
print(blue('What sort of changes have been made since the last release?'));
final selected = menu(prompt: 'Select the change level:', options: options);
if (selected is _CustomVersion) {
selected.requestCustomVersion();
}
return confirmVersion(selected.version);
}