'use strict';
var fs = require('fs'),
    dateFormat = require('dateformat'),
    git = require('../lib/git'),
    path = require('path'),
    util = require('util'),
    semver = require('semver'),
    yeoman = require('yeoman-generator');

var ReleaseNotesGenerator = module.exports = function ReleaseNotesGenerator(args, options, config) {
  yeoman.generators.NamedBase.apply(this, arguments);

  this.date = dateFormat(new Date(), 'mmmm dS, yyyy');

  if (this.name !== 'major' && this.name !== 'minor' && this.name !== 'patch') {
    throw new Error('"' + this.name + '" must be one of {major, minor, patch}');
  }
};

util.inherits(ReleaseNotesGenerator, yeoman.generators.NamedBase);

ReleaseNotesGenerator.prototype.ensureClean = git.ensureClean;
ReleaseNotesGenerator.prototype.ensureFetched = git.ensureFetched;

ReleaseNotesGenerator.prototype.readVersions = function() {
  var config;
  try {
    config = JSON.parse(fs.readFileSync('bower.json'));
  } catch (err) {
    config = JSON.parse(fs.readFileSync('package.json'));
  }

  this.priorVersion = 'v' + config.version;
  this.version = 'v' + semver.inc(this.priorVersion, this.name);
};

ReleaseNotesGenerator.prototype.loadNotes = function() {
  try {
    this.existing = fs.readFileSync('RELEASE.md');
    this.notesName = 'RELEASE.md';
  } catch (err) {
    try {
      this.existing = fs.readFileSync('release-notes.md');
      this.notesName = 'release-notes.md';
    } catch (err) {
      /* NOP */
    }
  }

  if (this.existing) {
    this.existing = this.existing.toString();
    this.firstCommit = this.priorVersion;
  }
};

ReleaseNotesGenerator.prototype.originName = git.originName;
ReleaseNotesGenerator.prototype.findFirstCommit = git.findFirstCommit;
ReleaseNotesGenerator.prototype.commitTime = git.commitTime;
ReleaseNotesGenerator.prototype.findChanges = git.findChanges;

ReleaseNotesGenerator.prototype.updateNotes = function() {
  var notes = this.existing;
  if (!notes) {
    notes = this.engine(this.read('_release-notes.md'), this);
  }

  notes = notes.replace(/\.\.\.master/, '...' + this.version);
  notes = notes.replace(/## Development\n/, '## Development\n' + this.engine(this.read('_version.md'), this));
  this.write(this.notesName || 'release-notes.md', notes);
};

@@ -391,16 +391,199 @@
 ents);%0A%0A
+  this.option('dry-run', %7B%0A    desc: 'Finds the changes that will be recorded and log to the console rather than disk',%0A    type: 'Boolean'%0A  %7D);%0A  this.dryRun = options%5B'dry-run'%5D;%0A%0A
   this.d
@@ -2090,24 +2090,127 @@
 unction() %7B%0A
+  if (this.dryRun) %7B%0A    this.log.write(this.engine(this.read('_version.md'), this));%0A    return;%0A  %7D%0A%0A
   var notes 

Add --dry-run option to release notes generator