keep-a-changelog
Advanced tools
Comparing version 0.10.2 to 0.10.4
18
bin.js
@@ -14,3 +14,3 @@ #!/usr/bin/env node | ||
}, | ||
boolean: ['https', 'init', 'latest-release', 'release', 'quiet'], | ||
boolean: ['https', 'init', 'latest-release', 'quiet'], | ||
}); | ||
@@ -44,3 +44,11 @@ | ||
const release = changelog.releases.find((release) => { | ||
return !release.date && release.version; | ||
if (release.date) { | ||
return false; | ||
} | ||
if (typeof argv.release === "string") { | ||
return !release.version || argv.release === release.version.toString(); | ||
} | ||
return !!release.version; | ||
}); | ||
@@ -50,2 +58,8 @@ | ||
release.date = new Date(); | ||
if (typeof argv.release === "string") { | ||
release.setVersion(argv.release); | ||
} | ||
} else { | ||
console.error("Not found any valid unreleased version"); | ||
process.exit(1); | ||
} | ||
@@ -52,0 +66,0 @@ } |
@@ -8,2 +8,10 @@ # Changelog | ||
## [0.10.4] - 2021-03-04 | ||
### Fixed | ||
- Allow to pass a version number to `--release` command [#18] | ||
## [0.10.3] - 2021-01-09 | ||
### Fixed | ||
- Support for multiline links [#16] | ||
## [0.10.2] - 2020-10-11 | ||
@@ -169,3 +177,7 @@ ### Added | ||
[#15]: https://github.com/oscarotero/keep-a-changelog/issues/15 | ||
[#16]: https://github.com/oscarotero/keep-a-changelog/issues/16 | ||
[#18]: https://github.com/oscarotero/keep-a-changelog/issues/18 | ||
[0.10.4]: https://github.com/oscarotero/keep-a-changelog/compare/v0.10.3...v0.10.4 | ||
[0.10.3]: https://github.com/oscarotero/keep-a-changelog/compare/v0.10.2...v0.10.3 | ||
[0.10.2]: https://github.com/oscarotero/keep-a-changelog/compare/v0.10.1...v0.10.2 | ||
@@ -172,0 +184,0 @@ [0.10.1]: https://github.com/oscarotero/keep-a-changelog/compare/v0.10.0...v0.10.1 |
@@ -5,3 +5,3 @@ { | ||
"homepage": "https://github.com/oscarotero/keep-a-changelog#readme", | ||
"version": "0.10.2", | ||
"version": "0.10.4", | ||
"main": "src/index.js", | ||
@@ -8,0 +8,0 @@ "bin": { |
@@ -99,3 +99,3 @@ const Changelog = require('./Changelog'); | ||
.split('\n') | ||
.map((line) => { | ||
.map((line, index, allLines) => { | ||
if (line.startsWith('---')) { | ||
@@ -128,2 +128,10 @@ return ['hr', ['-']]; | ||
} | ||
if (line.match(/^\[.*\]\:$/)) { | ||
const nextLine = allLines[index + 1]; | ||
if (nextLine && nextLine.match(/\s+http.*$/)) { | ||
// We found a multi-line link: treat it like a single line | ||
allLines[index + 1] = ''; | ||
return ['link', [line.trim() + '\n' + nextLine.trimEnd()]]; | ||
} | ||
} | ||
@@ -130,0 +138,0 @@ return ['p', [line.trimEnd()]]; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30869
550