Skip to content
Browse files

Merge pull request #4 from drewfish/master

latest
  • Loading branch information...
2 parents 4fc25e7 + 83a99d9 commit 2a45553622e0ebce847aa118ccbc23f71318c47d @drewfish drewfish committed May 12, 2012
Showing with 16 additions and 3 deletions.
  1. +5 −3 Readme.md
  2. +3 −0 crank.json
  3. +8 −0 lib/op-changelog.js
View
8 Readme.md
@@ -98,14 +98,16 @@ updates changelog. {file} defaults to `Changelog.md`
* `regexp`: string
* `replace`: string
* if results in `--CRANK:SKIP--` then change is skipped
- * `versions`:
+ * `releases`:
* `dateformat`: string
* format to use for revision dates
- * `filters`: list of objects describing how to modify versions
+ * `filters`: list of objects describing how to modify releases
* `subject`: string `version`, `date`, or `changeid`
* `regexp`: string
* `replace`: string
- * if results in `--CRANK:SKIP--` then version is skipped
+ * if results in `--CRANK:SKIP--` then release is skipped
+ * `skipEmpty`: boolean
+ * if true and release has no changes (after filtering), then the release is skipped
## template
View
3 crank.json
@@ -17,6 +17,9 @@
"replace": "--CRANK:SKIP--"
}
]
+ },
+ "releases": {
+ "skipEmpty": true
}
}
}
View
8 lib/op-changelog.js
@@ -73,13 +73,16 @@ OPChangelog.prototype.run = function(command) {
currentChangeID,
latestChangeID,
changes,
+ skipEmpty,
latestVersion,
rendered = '';
if (command.args[0]) {
this.base.config.changelog.file = command.args.shift();
}
+ skipEmpty = me.base.config.changelog.releases && me.base.config.changelog.releases.skipEmpty;
+
libasync.series([
// read db
@@ -151,6 +154,11 @@ OPChangelog.prototype.run = function(command) {
changes = me.base.filter(changes,
me.base.config.changelog.changes.filters);
+ if (!changes.length && skipEmpty) {
+ console.log('NOTICE: skipped empty release ' + latestVersion);
+ return;
+ }
+ me.base.config.changelog.releases
changes.forEach(function(change) {
change.date = libdateformat(change.date,
me.base.config.changelog.changes.dateformat);

0 comments on commit 2a45553

Please sign in to comment.
Something went wrong with that request. Please try again.