index.js
function getAllTags(version, cwd, repo, cb) {
  var str = 'git for-each-ref --format="%(tag)" --sort=\'*authordate\' refs/tags | sed \'1!G;h;$!d\'';
  exec(str, {cwd: cwd}, function (err, stdout, stderr) {

    var output = '';

    if (err) { return cb(err); }

    var stdoutAsString = stdout.toString('utf8');

    // Get the latest tag
    var lastTag = stdoutAsString.split('\n')[0];

    getTagDate(lastTag, function (err, tagDateAsString) {
      if (err) { return cb(err); }

      output += format('## [%s] -%s\n\n', version, tagDateAsString);
      output += '### Fixed\n\n';

      var str = 'git --no-pager log --pretty="format:- [] %%s (\\`%%an\\`)%%n  https://github.com/%s/commit/%H" "%s..HEAD"';
      str = format(str, repo, lastTag);

      exec(str, {cwd: cwd}, function (err, stdout, stderr) {
        if (err) { return cb(err); }
        output += stdout;

        return cb(null, output);
      });
    });
  });
}
function getAllTags(version, cwd, repo, cb) {
  var str = 'git for-each-ref --format="%(tag)" --sort=\'*authordate\' refs/tags | sed \'1!G;h;$!d\'';
  exec(str, {cwd: cwd}, function (err, stdout, stderr) {

    var output = '';

    if (err) { return cb(err); }

    var stdoutAsString = stdout.toString('utf8');

    // Get the latest tag
    var lastTag = stdoutAsString.split('\n')[0];

    getTagDate(lastTag, function (err, tagDateAsString) {
      if (err) { return cb(err); }

      output += format('## [%s] -%s\n\n', version, tagDateAsString);
      output += '### Fixed\n\n';

      var str = 'git --no-pager log --pretty="format:- [] %%s (\\`%%an\\`)%%n  https://github.com/%s/commit/%H" "%s..HEAD"';
      str = format(str, repo, lastTag);

      exec(str, {cwd: cwd}, function (err, stdout, stderr) {
        if (err) { return cb(err); }
        output += stdout;

        return cb(null, output);
      });
    });
  });
}
function getAllTags ( version , cwd , repo , cb ) { var str = 'git for-each-ref --format="%(tag)" --sort=\'*authordate\' refs/tags | sed \'1!G;h;$!d\'' ; exec ( str , { cwd : cwd } , function ( err , stdout , stderr ) { var output = '' ; if ( err ) { return cb ( err ) ; } var stdoutAsString = stdout . toString ( 'utf8' ) ; // Get the latest tag var lastTag = stdoutAsString . split ( '\n' ) [ 0 ] ; getTagDate ( lastTag , function ( err , tagDateAsString ) { if ( err ) { return cb ( err ) ; } output += format ( '## [%s] -%s\n\n' , version , tagDateAsString ) ; output += '### Fixed\n\n' ; var str = 'git --no-pager log --pretty="format:- [] %%s (\\`%%an\\`)%%n  https://github.com/%s/commit/%H" "%s..HEAD"' ; str = format ( str , repo , lastTag ) ; exec ( str , { cwd : cwd } , function ( err , stdout , stderr ) { if ( err ) { return cb ( err ) ; } output += stdout ; return cb ( null , output ) ; } ) ; } ) ; } ) ; }
Get all existing tags ordered descending on date
Get all existing tags ordered descending on date