File tree 3 files changed +29
-5
lines changed
3 files changed +29
-5
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env node
2
2
3
+ require ( 'buggin' ) ( module )
3
4
const cli = require ( 'commander' )
4
5
const chalk = require ( 'chalk' )
5
6
const opn = require ( 'open' )
49
50
process . exitCode = 0
50
51
}
51
52
} catch ( err ) {
52
- console . error ( err )
53
- process . exitCode = 1
53
+ if ( err && typeof err === 'object' ) {
54
+ if ( / E N O T F O U N D / . test ( err . message ) ) {
55
+ process . exitCode = 1
56
+ return console . error ( `${ chalk . red ( 'Problem!' ) } Unable to find api.github.com.\nPlease check your network connection and/or DNS configuration.` )
57
+ }
58
+ // add more cases here as they come up, and present user-friendly messages
59
+ }
60
+
61
+ // let buggin handle it if it's anything else
62
+ throw err
54
63
}
55
64
} )
56
65
. parse ( process . argv )
Original file line number Diff line number Diff line change 20
20
],
21
21
"repository" : {
22
22
"type" : " git" ,
23
- "url" : " https://github.com/bnb /good-first-issue.git"
23
+ "url" : " https://github.com/cutenode /good-first-issue.git"
24
24
},
25
- "homepage" : " https://github.com/bnb /good-first-issue" ,
25
+ "homepage" : " https://github.com/cutenode /good-first-issue" ,
26
26
"keywords" : [
27
27
" cli" ,
28
28
" node-cli" ,
43
43
"node" : " >=8.0.0"
44
44
},
45
45
"bugs" : {
46
- "url" : " https://github.com/bnb /good-first-issue/issues" ,
46
+ "url" : " https://github.com/cutenode /good-first-issue/issues" ,
47
47
48
48
},
49
49
"contributors" : [
50
50
" Dhruv Jain <[email protected] > (https://maddhruv.github.io)"
51
51
],
52
52
"dependencies" : {
53
53
"boxen" : " ^3.0.0" ,
54
+ "buggin" : " ^0.1.5" ,
54
55
"chalk" : " ^2.4.1" ,
55
56
"commander" : " ^2.19.0" ,
56
57
"inquirer" : " ^6.2.0" ,
57
58
"libgfi" : " ^1.0.2" ,
58
59
"open" : " ^6.4.0"
59
60
},
60
61
"devDependencies" : {
62
+ "execa" : " ^3.3.0" ,
61
63
"jest" : " ^23.6.0" ,
62
64
"strip-ansi" : " ^5.0.0" ,
63
65
"standard" : " ^14.0.0"
Original file line number Diff line number Diff line change
1
+ const execa = require ( 'execa' )
2
+
3
+ const BIN_PATH = require . resolve ( '../bin/good-first-issue.js' )
4
+
5
+ test ( 'should display link to report bug if project not found' , async ( ) => {
6
+ return expect (
7
+ execa ( process . execPath , [
8
+ BIN_PATH ,
9
+ 'marvin-k-mooney/would-you-please-go-now'
10
+ ] )
11
+ )
12
+ . resolves . toMatchObject ( { stderr : / T h e f o l l o w i n g u n h a n d l e d r e j e c t i o n i s l i k e l y a b u g i n g o o d - f i r s t - i s s u e / } )
13
+ } ) ;
You can’t perform that action at this time.
0 commit comments