mirror of
https://github.com/facebook/docusaurus.git
synced 2025-12-25 17:22:50 +00:00
try to fix tinyglobby error on windows
This commit is contained in:
parent
267a800e7a
commit
1c13e463a0
|
|
@ -6,7 +6,6 @@
|
|||
*/
|
||||
|
||||
import fs from 'fs-extra';
|
||||
import logger from '@docusaurus/logger';
|
||||
import traverse, {type Node} from '@babel/traverse';
|
||||
import generate from '@babel/generator';
|
||||
import {
|
||||
|
|
@ -56,8 +55,10 @@ export async function extractSourceCodeFileTranslations(
|
|||
);
|
||||
return translations;
|
||||
} catch (err) {
|
||||
logger.error`Error while attempting to extract Docusaurus translations from source code file at path=${sourceCodeFilePath}.`;
|
||||
throw err;
|
||||
throw new Error(
|
||||
`Error while attempting to extract Docusaurus translations from source code file at path=${sourceCodeFilePath}.`,
|
||||
{cause: err as Error},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -136,6 +136,8 @@ export const isTranslatableSourceFile: (filePath: string) => boolean = (() => {
|
|||
export async function globTranslatableSourceFiles(
|
||||
patterns: string[],
|
||||
): Promise<string[]> {
|
||||
const filePaths = await safeGlobby(patterns);
|
||||
const filePaths = await safeGlobby(patterns, {
|
||||
absolute: true,
|
||||
});
|
||||
return filePaths.filter(isTranslatableSourceFile);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue