File tree Expand file tree Collapse file tree 1 file changed +20
-8
lines changed
Expand file tree Collapse file tree 1 file changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -161,14 +161,26 @@ function parseSkillMetadata(skillPath) {
161161 return null ;
162162 }
163163
164- // List bundled assets (all files except SKILL.md)
165- const assets = fs
166- . readdirSync ( skillPath )
167- . filter ( ( file ) => {
168- const filePath = path . join ( skillPath , file ) ;
169- return file !== "SKILL.md" && fs . statSync ( filePath ) . isFile ( ) ;
170- } )
171- . sort ( ) ;
164+ // List bundled assets (all files except SKILL.md), recursing through subdirectories
165+ const getAllFiles = ( dirPath , arrayOfFiles = [ ] ) => {
166+ const files = fs . readdirSync ( dirPath ) ;
167+
168+ files . forEach ( ( file ) => {
169+ const filePath = path . join ( dirPath , file ) ;
170+ if ( fs . statSync ( filePath ) . isDirectory ( ) ) {
171+ arrayOfFiles = getAllFiles ( filePath , arrayOfFiles ) ;
172+ } else {
173+ const relativePath = path . relative ( skillPath , filePath ) ;
174+ if ( relativePath !== "SKILL.md" ) {
175+ arrayOfFiles . push ( relativePath ) ;
176+ }
177+ }
178+ } ) ;
179+
180+ return arrayOfFiles ;
181+ } ;
182+
183+ const assets = getAllFiles ( skillPath ) . sort ( ) ;
172184
173185 return {
174186 name : frontmatter . name ,
You can’t perform that action at this time.
0 commit comments