Skip to content

Commit

Permalink
Refactor promises (#33)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
alexcanessa authored Mar 9, 2017
1 parent ba12e23 commit a4cca14
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 149 deletions.
12 changes: 1 addition & 11 deletions bin/gren.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
#!/usr/bin/env node

'use strict';

var GithubReleaseNotes = require('./src/gren');
var gren = new GithubReleaseNotes();
var utils = require('./src/utils');
var action = utils.getBashOptions(process.argv)['action'];

gren.init()
.then(function() {
return gren[action || 'release']();
});
require('../github-release-notes');
5 changes: 5 additions & 0 deletions github-release-notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,9 @@ var action = utils.getBashOptions(process.argv)['action'];
gren.init()
.then(function() {
return gren[action || 'release']();
})
.catch(function(error) {
utils.clearTasks(gren);

console.error(error);
});
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
"chalk": "^1.1.3",
"connectivity": "^1.0.0",
"es6-promise": "^3.2.1",
"github-api": "^2.1.0",
"is-online": "^5.1.1",
"github-api": "^3.0.0",
"object-assign": "^4.1.0"
},
"devDependencies": {
Expand Down
Loading

0 comments on commit a4cca14

Please sign in to comment.