Methods
(inner) getVersion(resource, cb)
Get version value from the changelog's latest release.
It's common for the latest release of a changelog to be 'Unreleased', in
order to indicate that it's the one currently in progress. Hence the
version is resolved in this order:
1. when latest release has a version number, use that version
2. when latest release is 'Unreleased' (version is undefined after
parsing), use the previous release's version
3. otherwise default to '0.0.0'
- Source:
Parameters:
| Name |
Type |
Description |
resource |
Object
|
resource configuration
| Name |
Type |
Description |
path |
String
|
path to the changelog file
|
|
cb |
function
|
standard cb(err, result) callback, result is the
version value
|
(inner) isReadyForRelease(resource, cb)
Check that the changelog is ready for release, i.e. its latest release is
an Unreleased section (`## Unreleased` or `## [Unreleased]`) which is not
empty. Otherwise there is nothing to release, and setting the release
version would rename the latest release instead.
- Source:
Parameters:
| Name |
Type |
Description |
resource |
Object
|
resource configuration
| Name |
Type |
Description |
path |
String
|
path to the changelog file
|
|
cb |
function
|
standard cb(err, result) callback, result is true
when the changelog is ready for release, an error is passed when the
changelog can't be parsed, has no Unreleased section, or the Unreleased
section is empty
|
(inner) setPostReleaseVersion(version, resource, opts, cb)
Add a new Unreleased section to the top of the changelog.
The version value is not written to the changelog, Unreleased section
represents the next pre-release version instead.
- Source:
Parameters:
| Name |
Type |
Description |
version |
String
|
post-release version value, unused
|
resource |
Object
|
resource configuration
| Name |
Type |
Description |
path |
String
|
path to the changelog file
|
|
opts |
Object
|
optional settings
| Name |
Type |
Attributes |
Description |
dryRun |
Boolean
|
<optional>
|
when true, changelog file won't be
modified
|
tagFormat |
String
|
|
SCM tag format used in release links,
e.g. v{version}
|
|
cb |
function
|
standard cb(err, result) callback
|
(inner) setReleaseVersion(version, resource, opts, cb)
Set release version on the latest release within the changelog, with date
set to current date.
- Source:
Parameters:
| Name |
Type |
Description |
version |
String
|
version value to set
|
resource |
Object
|
resource configuration
| Name |
Type |
Description |
path |
String
|
path to the changelog file
|
|
opts |
Object
|
optional settings
| Name |
Type |
Attributes |
Description |
dryRun |
Boolean
|
<optional>
|
when true, changelog file won't be
modified
|
tagFormat |
String
|
|
SCM tag format used in release links,
e.g. v{version}
|
|
cb |
function
|
standard cb(err, result) callback
|