File tree 1 file changed +18
-12
lines changed
1 file changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -6,20 +6,26 @@ var utils = require('./utils');
6
6
7
7
// working around github-url-to-object used inside get-package-readme
8
8
// that cannot handle www.github.com urls
9
+ // this does NOT work on npm2 where it cannot find github-url-to-object
10
+ // due to multi level folder
9
11
/* eslint no-undef:0 */
10
- require = require ( 'really-need' ) ;
11
- require ( 'github-url-to-object' , {
12
- post : function ( ) {
13
- return function gh ( url ) {
14
- log ( 'parsing github url %s ourselves' , url ) ;
15
- var parsed = parseGithubRepoUrl ( url ) ;
16
- return {
17
- user : parsed [ 0 ] ,
18
- repo : parsed [ 1 ]
12
+ try {
13
+ require = require ( 'really-need' ) ;
14
+ require ( 'github-url-to-object' , {
15
+ post : function ( ) {
16
+ return function gh ( url ) {
17
+ log ( 'parsing github url %s ourselves' , url ) ;
18
+ var parsed = parseGithubRepoUrl ( url ) ;
19
+ return {
20
+ user : parsed [ 0 ] ,
21
+ repo : parsed [ 1 ]
22
+ } ;
19
23
} ;
20
- } ;
21
- }
22
- } ) ;
24
+ }
25
+ } ) ;
26
+ } catch ( err ) {
27
+ // ignore
28
+ }
23
29
24
30
var Promise = require ( 'bluebird' ) ;
25
31
var getReadmeFile = Promise . promisify ( require ( 'get-package-readme' ) ) ;
You can’t perform that action at this time.
0 commit comments