Commit d2d72807 authored by David Breitling's avatar David Breitling
Browse files

[FEATURE] directly specify version bump

parent 08fc79e3
......@@ -23,19 +23,28 @@ module.exports = class Open extends Task {
this._logger.error(`Could not find extension in ${yargs.ext}!`);
resolve();
} else {
const answers = await inquirer.prompt([
{
type: 'confirm',
name: 'major',
message: 'Does the user need to apply changes to the code base or configuration after installing your update?'
},
{
type: 'confirm',
name: 'feature',
message: 'Did you develop new features?',
when: answers => !answers.major
if (yargs.major || yargs.minor || yargs.feature || yargs.patch) {
var answers_tmp = {
major: !!yargs.major,
feature: !!yargs.minor || !!yargs.feature,
patch: !!yargs.patch
}
]);
} else {
var answers_tmp = await inquirer.prompt([
{
type: 'confirm',
name: 'major',
message: 'Does the user need to apply changes to the code base or configuration after installing your update?'
},
{
type: 'confirm',
name: 'feature',
message: 'Did you develop new features?',
when: answers_v => !answers_v.major
}
]);
}
const answers = answers_tmp
try {
let pathToComposer = `${process.cwd()}/${this._config.directories.basePath}/${yargs.ext}/composer.json`,
pathToExtEmconf = `${process.cwd()}/${this._config.directories.basePath}/${yargs.ext}/ext_emconf.php`,
......@@ -61,6 +70,7 @@ module.exports = class Open extends Task {
_getNextVersionNumber(answers, currentVersion) {
let numbers = currentVersion.split('.');
if (answers.major) {
this._logger.warning("You are releasing a new major version. Make sure you know what that entails.")
numbers[0] = parseInt(numbers[0]) + 1;
numbers[1] = 0;
numbers[2] = 0;
......@@ -70,6 +80,7 @@ module.exports = class Open extends Task {
} else {
numbers[2] = parseInt(numbers[2]) + 1;
}
this._logger.info(`Bumping version number of ${yargs.ext}: ${currentVersion} => ${numbers[0]}.${numbers[1]}.${numbers[2]}`)
return `${numbers[0]}.${numbers[1]}.${numbers[2]}`;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment