File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
packages/docusaurus/src/commands Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -47,12 +47,16 @@ export async function writeHeadingIds(
4747) : Promise < void > {
4848 const siteDir = await fs . realpath ( siteDirParam ) ;
4949
50- const markdownFiles = await safeGlobby (
51- files ?? ( await getPathsToWatch ( siteDir ) ) ,
52- {
53- expandDirectories : [ '**/*.{md,mdx}' ] ,
54- } ,
55- ) ;
50+ const patterns = files . length ? files : await getPathsToWatch ( siteDir ) ;
51+
52+ const markdownFiles = await safeGlobby ( patterns , {
53+ expandDirectories : [ '**/*.{md,mdx}' ] ,
54+ } ) ;
55+
56+ if ( markdownFiles . length === 0 ) {
57+ logger . warn `No markdown files found in siteDir path=${ siteDir } for patterns: ${ patterns } ` ;
58+ return ;
59+ }
5660
5761 const result = await Promise . all (
5862 markdownFiles . map ( ( p ) => transformMarkdownFile ( p , options ) ) ,
You can’t perform that action at this time.
0 commit comments