File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -662,12 +662,14 @@ async function serveImpl(
662662 }
663663
664664 // skills add: generate skill files and install via `<pm>x skills add` (only when sync is configured)
665- const skillsIdx =
666- findBuiltin ( filtered [ 0 ] ! ) ?. name === 'skills'
667- ? 0
668- : filtered [ 0 ] === name && findBuiltin ( filtered [ 1 ] ! ) ?. name === 'skills'
669- ? 1
670- : - 1
665+ const skillsIdx = ( ( ) => {
666+ // e.g. `skills add` or `skill add`
667+ if ( findBuiltin ( filtered [ 0 ] ! ) ?. name === 'skills' ) return 0
668+ // e.g. `my-cli skills add`
669+ if ( filtered [ 0 ] === name && findBuiltin ( filtered [ 1 ] ! ) ?. name === 'skills' ) return 1
670+ // not a skills invocation
671+ return - 1
672+ } ) ( )
671673 if ( skillsIdx !== - 1 ) {
672674 const skillsSub = filtered [ skillsIdx + 1 ]
673675 if ( skillsSub && skillsSub !== 'add' && skillsSub !== 'list' ) {
You can’t perform that action at this time.
0 commit comments