File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ const searchBranches: Fig.Generator = {
21
21
return output . split ( "\n" ) . map ( ( elm ) => {
22
22
let name = elm . trim ( ) ;
23
23
const parts = elm . match ( / \S + / g) ;
24
- if ( parts . length > 1 ) {
24
+ if ( parts && parts . length > 1 ) {
25
25
if ( parts [ 0 ] == "*" ) {
26
26
// Current branch.
27
27
return {
@@ -991,6 +991,10 @@ const completionSpec: Fig.Spec = {
991
991
script : string [ ] ;
992
992
} ;
993
993
994
+ if ( postProcess === undefined ) {
995
+ return undefined ;
996
+ }
997
+
994
998
const packages = postProcess (
995
999
(
996
1000
await executeShellCommand ( {
@@ -999,10 +1003,12 @@ const completionSpec: Fig.Spec = {
999
1003
} )
1000
1004
) . stdout ,
1001
1005
tokens
1002
- ) . map ( ( { name } ) => name as string ) ;
1006
+ )
1007
+ ?. filter ( ( e ) => e !== null )
1008
+ . map ( ( { name } ) => name as string ) ;
1003
1009
1004
1010
const subcommands = packages
1005
- . filter ( ( name ) => nodeClis . has ( name ) )
1011
+ ? .filter ( ( name ) => nodeClis . has ( name ) )
1006
1012
. map ( ( name ) => ( {
1007
1013
name,
1008
1014
loadSpec : name ,
You can’t perform that action at this time.
0 commit comments