@@ -84,35 +84,20 @@ class DocumentationValidator {
8484 }
8585
8686 // Get all markdown files in docs directory
87- // Try different possible locations
88- const possibleDocsPaths = [
89- path . join ( process . cwd ( ) , 'docs' ) ,
90- path . join ( process . cwd ( ) , '..' , 'docs' ) , // If running from docusaurus/
91- path . join ( __dirname , '..' , 'docs' ) ,
92- path . join ( __dirname , '..' , '..' , 'docs' )
93- ] ;
87+ // The script runs from docusaurus/ directory, so docs/ is relative to that
88+ const docsPath = path . join ( process . cwd ( ) , 'docs' ) ;
9489
95- let docsPath = null ;
96-
97- for ( const testPath of possibleDocsPaths ) {
98- if ( fs . existsSync ( testPath ) ) {
99- docsPath = testPath ;
100- this . log ( `π Using docs path: ${ docsPath } ` , 'debug' ) ;
101- break ;
102- }
103- }
104-
105- if ( ! docsPath ) {
106- this . log ( 'β docs/ directory not found in any expected location' , 'error' ) ;
107- this . log ( 'π‘ Tried paths:' , 'debug' ) ;
108- possibleDocsPaths . forEach ( p => this . log ( ` - ${ p } ` , 'debug' ) ) ;
90+ if ( ! fs . existsSync ( docsPath ) ) {
91+ this . log ( 'β docs/ directory not found' , 'error' ) ;
92+ this . log ( `π‘ Looking in: ${ docsPath } ` , 'debug' ) ;
10993 return [ ] ;
11094 }
11195
11296 const pattern = path . join ( docsPath , '**/*.{md,mdx}' ) ;
11397 const files = glob . sync ( pattern ) ;
114- this . log ( `π Pattern used: ${ pattern } ` , 'debug' ) ;
115- this . log ( `π Found files: ${ files . slice ( 0 , 5 ) . join ( ', ' ) } ${ files . length > 5 ? '...' : '' } ` , 'debug' ) ;
98+
99+ this . log ( `π Pattern: ${ pattern } ` , 'debug' ) ;
100+ this . log ( `π Found ${ files . length } files` , 'debug' ) ;
116101
117102 return files ;
118103 }
0 commit comments