Skip to content

Commit 76bd129

Browse files
committed
Divide the source code from the exec, creating the release() function
1 parent e70f508 commit 76bd129

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

github-release-notes.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
'use strict';
22

3-
var githubReleaseNotes = require('./lib/index');
3+
var GithubReleaseNotes = require('./src/index');
4+
var gren = new GithubReleaseNotes();
5+
6+
gren.release();

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "github-release-notes",
33
"version": "0.2.0",
44
"description": "Node module to publish release notes based on commits between the last two tags.",
5-
"main": "./src/index.js",
5+
"main": "./github-release-notes.js",
66
"scripts": {
77
"start": "node github-release-notes.js",
88
"test": "echo \"Error: no test specified\" && exit 1"

src/index.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ function createBody(message) {
4444
/**
4545
* Transforms the commits to commit messages
4646
*
47-
* @param {[Object]} commits The array of object containing the commits
47+
* @param {Object[]} commits The array of object containing the commits
4848
*
49-
* @return {Array}
49+
* @return {String[]}
5050
*/
5151
function commitMessages(commits) {
5252
return commits.map(function (commitObject) {
@@ -204,7 +204,7 @@ function GithubReleaseNotes(options) {
204204
/**
205205
* Get All the tags, get the dates, get the commits between those dates and prepeare the release
206206
*/
207-
GithubReleaseNotes.prototype.init = function() {
207+
GithubReleaseNotes.prototype.release = function() {
208208
var that = this;
209209

210210
getLatestRelease(that).then(function (releaseTagName) {
@@ -224,7 +224,4 @@ GithubReleaseNotes.prototype.init = function() {
224224
});
225225
};
226226

227-
var gren = new GithubReleaseNotes();
228-
gren.init();
229-
230227
module.exports = GithubReleaseNotes;

0 commit comments

Comments
 (0)