mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-21 10:37:51 +02:00
fix(content-docs): suppress git error on multiple occurrences (#6973)
This commit is contained in:
parent
b456a64f61
commit
4b3f568b78
6 changed files with 112 additions and 57 deletions
|
@ -31,17 +31,18 @@ export async function getFileLastUpdate(
|
|||
});
|
||||
return {timestamp: result.timestamp, author: result.author};
|
||||
} catch (err) {
|
||||
if (err instanceof GitNotFoundError && !showedGitRequirementError) {
|
||||
logger.warn('Sorry, the docs plugin last update options require Git.');
|
||||
showedGitRequirementError = true;
|
||||
} else if (
|
||||
err instanceof FileNotTrackedError &&
|
||||
!showedFileNotTrackedError
|
||||
) {
|
||||
logger.warn(
|
||||
'Cannot infer the update date for some files, as they are not tracked by git.',
|
||||
);
|
||||
showedFileNotTrackedError = true;
|
||||
if (err instanceof GitNotFoundError) {
|
||||
if (!showedGitRequirementError) {
|
||||
logger.warn('Sorry, the docs plugin last update options require Git.');
|
||||
showedGitRequirementError = true;
|
||||
}
|
||||
} else if (err instanceof FileNotTrackedError) {
|
||||
if (!showedFileNotTrackedError) {
|
||||
logger.warn(
|
||||
'Cannot infer the update date for some files, as they are not tracked by git.',
|
||||
);
|
||||
showedFileNotTrackedError = true;
|
||||
}
|
||||
} else {
|
||||
logger.warn(err);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue