mirror of
https://github.com/facebook/docusaurus.git
synced 2025-12-26 01:33:02 +00:00
test
This commit is contained in:
parent
f8afe40fa6
commit
5de3c259e6
|
|
@ -193,6 +193,12 @@ export async function getFileCommitDate(
|
|||
|
||||
// Test
|
||||
if (!output) {
|
||||
console.log('NO GIT OUTPUT', file);
|
||||
/*
|
||||
throw new FileNotTrackedError(
|
||||
`Failed to retrieve the git history for file "${file}" because the file is not tracked by git.`,
|
||||
);
|
||||
*/
|
||||
return {
|
||||
date: new Date(),
|
||||
timestamp: Date.now(),
|
||||
|
|
@ -203,6 +209,8 @@ export async function getFileCommitDate(
|
|||
const match = output.match(regex);
|
||||
|
||||
if (!match) {
|
||||
console.log('NO GIT MATCH', file);
|
||||
|
||||
return {
|
||||
date: new Date(),
|
||||
timestamp: Date.now(),
|
||||
|
|
@ -210,6 +218,8 @@ export async function getFileCommitDate(
|
|||
};
|
||||
}
|
||||
|
||||
console.log('GIT MATCH', file, match.groups!.timestamp, match.groups!.author);
|
||||
|
||||
const timestampInSeconds = Number(match.groups!.timestamp);
|
||||
const timestamp = timestampInSeconds * 1_000;
|
||||
const date = new Date(timestamp);
|
||||
|
|
|
|||
Loading…
Reference in New Issue