Commit 8393a3af authored by Stefan Galinski's avatar Stefan Galinski 🎮
Browse files

Merge branch 'feature_releaseExtension-directly-specify-semver-increase' into 'master'

Feature: directly specify semver increase with flag when using releaseExtension

See merge request !4
parents 08fc79e3 c45ac3a2
......@@ -23,19 +23,30 @@ 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?',
default: false
},
{
type: 'confirm',
name: 'feature',
message: 'Did you develop new features?',
default: false,
when: (answers_tmp) => !answers_tmp.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 +72,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 +82,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