Skip to content

Commit

Permalink
fix(readme): fixed getting readme by downgrading simple-get, fixes #24
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov committed Apr 4, 2016
1 parent 557347e commit e7e15a2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ Just run the tool with `DEBUG=manpm manpm ...` environment setting.
$ DEBUG=manpm manpm object-fitter
manpm fetching README for package +0ms object-fitter

Good testing commands:

DEBUG=manpm npm run example-es6-docs

## Inspired by the following tools

* [man-n](https://github.com/man-n/man-n)
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"marked-to-md": "1.0.1",
"package-json": "2.3.2",
"simple-bin-help": "1.6.0",
"simple-get": "2.0.0",
"simple-get": "1.4.3",
"update-notifier": "0.6.3"
},
"preferGlobal": true,
Expand Down Expand Up @@ -91,6 +91,9 @@
],
"post-commit": [],
"post-merge": []
},
"next-update": {
"skip": "simple-get"
}
},
"devDependencies": {
Expand Down
4 changes: 4 additions & 0 deletions src/get-readme.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var log = require('debug')('manpm');
var la = require('lazy-ass');
var check = require('check-more-types');
Expand All @@ -16,6 +18,8 @@ function get(url) {
return reject(err);
}
if (res.statusCode !== 200) {
log('while fetching from', url, 'got', res.statusCode);
log(res);
return reject(new Error('GET from ' + url + ' status ' + res.statusCode));
}
return resolve(data);
Expand Down
7 changes: 6 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var log = require('debug')('manpm');
var la = require('lazy-ass');
var check = require('check-more-types');
Expand All @@ -22,7 +24,10 @@ function maNpm(options) {
return getReadme(options.name)
.then(findSection.bind(null, options))
.then(printMarkdown)
.catch(console.error.bind(console));
.catch(function (err) {
console.error(err);
log(err.stack);
});
}

module.exports = maNpm;
Expand Down

0 comments on commit e7e15a2

Please sign in to comment.