Permalink
Browse files

show the author's name if the repo url is not in the module's package…

….json.
  • Loading branch information...
1 parent 88d0a2b commit 9a29769eaae2727c0187dd977a8bf527544e9098 @dylang committed Aug 23, 2011
Showing with 11 additions and 2 deletions.
  1. +11 −1 lib/npm.js
  2. +0 −1 readme.md
View
@@ -67,7 +67,17 @@ function versions(moduleName, cb) {
});
}
if (!repo) {
- err = new Error('Author of module ' + moduleName + ' did not specify the code repository url.');
+
+ var author;
+ if (data && data.author) {
+ author = data.author.name || 'Creator of Module';
+
+ if (data.author.email || data.author.url) {
+ author = author + ' (' + (data.author.email || data.author.url) + ')';
+ }
+ }
+
+ err = new Error((author ? author : 'Owner of module ') + ' did not specify the repository url in the package.json for ' + moduleName + '.');
}
if ((!err && !repo) || (data && !v.length)) {
err = new Error('Unknown package: ' + moduleName);
View
@@ -100,7 +100,6 @@ Future
* Ability to set the start and end version.
* Use Git tags to detect versions (waiting for Github to fix [Issue #17](https://github.com/github/developer.github.com/issues/17)).
* Add header and/or footer to the output with module name, contributors, etc.
- * If the package.json does not have a repository url then display the author's name and email and suggest contacting the author.
Want to help?
=============

0 comments on commit 9a29769

Please sign in to comment.