- Allow to run semantic-release (via API) from anywhere passing the current working directory. - Allows to simplify the tests and to run them in parallel in both the core and plugins.
16 lines
473 B
JavaScript
16 lines
473 B
JavaScript
const semver = require('semver');
|
|
const {FIRST_RELEASE} = require('./definitions/constants');
|
|
|
|
module.exports = ({nextRelease: {type}, lastRelease, logger}) => {
|
|
let version;
|
|
if (lastRelease.version) {
|
|
version = semver.inc(lastRelease.version, type);
|
|
logger.log('The next release version is %s', version);
|
|
} else {
|
|
version = FIRST_RELEASE;
|
|
logger.log('There is no previous release, the next release version is %s', version);
|
|
}
|
|
|
|
return version;
|
|
};
|