-
Notifications
You must be signed in to change notification settings - Fork 799
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: adds warning for -m and --message (#359)
- Loading branch information
1 parent
a6f816b
commit ab7e1da
Showing
8 changed files
with
62 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
const spec = require('conventional-changelog-config-spec') | ||
|
||
const defaults = { | ||
infile: 'CHANGELOG.md', | ||
firstRelease: false, | ||
sign: false, | ||
noVerify: false, | ||
commitAll: false, | ||
silent: false, | ||
tagPrefix: 'v', | ||
scripts: {}, | ||
skip: {}, | ||
dryRun: false, | ||
gitTagFallback: true, | ||
preset: 'conventionalcommits' | ||
} | ||
|
||
/** | ||
* Merge in defaults provided by the spec | ||
*/ | ||
Object.keys(spec.properties).forEach(propertyKey => { | ||
const property = spec.properties[propertyKey] | ||
defaults[propertyKey] = property.default | ||
}) | ||
|
||
module.exports = defaults |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,4 @@ | ||
const util = require('util') | ||
|
||
module.exports = function (rawMsg, newVersion) { | ||
/** | ||
* Since `args.message` (`rawMsg`) is used as the alias to `releaseCommitMessageFormat`, | ||
* we have to make sure the substitution defined by the `conventional-changelog-config-spec` | ||
* is handled properly. | ||
* @see https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/1.0.0/README.md#releasecommitmessageformat-string | ||
*/ | ||
const message = String(rawMsg).replace('{{currentTag}}', '%s') | ||
const matchCount = (message.match(/%s/g) || []).length | ||
const args = Array(1 + matchCount) | ||
args[0] = message | ||
args.fill(newVersion, 1, args.length) | ||
return util.format.apply(util, args) | ||
const message = String(rawMsg) | ||
return message.replace(/{{currentTag}}/g, newVersion) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters