From a2f663c0c08bd7cbc6316389d89d6c327b0bd7db Mon Sep 17 00:00:00 2001 From: Andy Joslin Date: Mon, 8 Jul 2013 20:26:30 -0400 Subject: [PATCH] fix: Write whether file exists or not --- tasks/changelog.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasks/changelog.js b/tasks/changelog.js index 5fe114d..39bb286 100644 --- a/tasks/changelog.js +++ b/tasks/changelog.js @@ -53,7 +53,8 @@ module.exports = function (grunt) { // generate changelog changelog.generate(githubRepo, 'v' + newVersion).then(function(data) { - grunt.file.write(options.dest, data + grunt.file.read(options.dest)); + var currentLog = grunt.file.exists(options.dest) ? grunt.file.read(options.dest) : ''; + grunt.file.write(options.dest, data + currentLog); if (options.editor) { exec(options.editor + ' ' + options.dest, function(err) {