File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
packages/angular/cli/commands Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -14,13 +14,17 @@ const opn = require('opn');
14
14
15
15
export class DocCommand extends Command < DocCommandSchema > {
16
16
public async run ( options : DocCommandSchema & Arguments ) {
17
- let searchUrl = `https://angular.io/api?query=${ options . keyword } ` ;
18
- if ( options . search ) {
19
- searchUrl = `https://www.google.com/search?q=site%3Aangular.io+${ options . keyword } ` ;
20
- }
17
+ if ( options . keyword ) {
18
+ let searchUrl = `https://angular.io/api?query=${ options . keyword } ` ;
19
+ if ( options . search ) {
20
+ searchUrl = `https://www.google.com/search?q=site%3Aangular.io+${ options . keyword } ` ;
21
+ }
21
22
22
- return opn ( searchUrl , {
23
+ return opn ( searchUrl , {
23
24
wait : false ,
24
- } ) ;
25
+ } ) ;
26
+ }
27
+ this . logger . error ( 'You should specify a keyword, for instance, `ng doc ActivatedRoute`.' ) ;
28
+ return 0 ;
25
29
}
26
30
}
You can’t perform that action at this time.
0 commit comments