From 4bd43154c727e803c4939afd9abe051ce67eb51c Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 26 Dec 2014 11:20:35 -0500 Subject: [PATCH] feature(changelog) add prepend --- gulp/tasks/changelog.js | 15 +++++++++++---- package.json | 1 + 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/gulp/tasks/changelog.js b/gulp/tasks/changelog.js index e7c665fe..674e659c 100644 --- a/gulp/tasks/changelog.js +++ b/gulp/tasks/changelog.js @@ -2,14 +2,21 @@ 'use strict'; var changelog = require('changelog-io'), + prepend = require('prepend'), cl = require('../cl'); module.exports = function(callback) { cl(function(error, versionNew) { - if (error) - callback(error); - else - changelog(versionNew, callback); + var e = function(error) { + if (error) + callback(error); + + return error; + }; + + e(error) || changelog(versionNew, function(error, data) { + e(error) || prepend('ChangeLog', data, callback); + }); }); }; })(); diff --git a/package.json b/package.json index cb60a0d5..b387acaa 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,7 @@ "minor": "~1.2.2", "morgan": "~1.5.0", "place": "~1.0.0", + "prepend": "~1.0.2", "should": "~4.4.1", "version-io": "~1.0.3" },