Skip to content

Commit a4cca14

Browse files
authored
Refactor promises (#33)
* Require github-release-notes.js in the bin file * Catch promises errors and handle them in a new way * Update github-api and remove is-online from package.json * Add hasNetwork check back in * Update the changelog * Kill all tasks when catching an error * Remove extra line in the changelog * Revert connectivity check
1 parent ba12e23 commit a4cca14

File tree

5 files changed

+120
-149
lines changed

5 files changed

+120
-149
lines changed

bin/gren.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
11
#!/usr/bin/env node
22

3-
'use strict';
4-
5-
var GithubReleaseNotes = require('./src/gren');
6-
var gren = new GithubReleaseNotes();
7-
var utils = require('./src/utils');
8-
var action = utils.getBashOptions(process.argv)['action'];
9-
10-
gren.init()
11-
.then(function() {
12-
return gren[action || 'release']();
13-
});
3+
require('../github-release-notes');

github-release-notes.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,9 @@ var action = utils.getBashOptions(process.argv)['action'];
88
gren.init()
99
.then(function() {
1010
return gren[action || 'release']();
11+
})
12+
.catch(function(error) {
13+
utils.clearTasks(gren);
14+
15+
console.error(error);
1116
});

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@
3535
"chalk": "^1.1.3",
3636
"connectivity": "^1.0.0",
3737
"es6-promise": "^3.2.1",
38-
"github-api": "^2.1.0",
39-
"is-online": "^5.1.1",
38+
"github-api": "^3.0.0",
4039
"object-assign": "^4.1.0"
4140
},
4241
"devDependencies": {

0 commit comments

Comments
 (0)