fix(shared): Make git author script more robust
This commit is contained in:
parent
83cb6b229c
commit
f15f6f93b3
1 changed files with 8 additions and 2 deletions
|
@ -34,8 +34,14 @@ export const getGitMetadata = async (file, site) => {
|
|||
}
|
||||
}
|
||||
if (!key) {
|
||||
console.log({ email, author, slug })
|
||||
throw `Git author email ${email} is unknown in the git-to-author table`
|
||||
if (typeof email === 'undefined' && typeof email === 'undefined') {
|
||||
// This means files lack git history (they are new and haven't been committed yet)
|
||||
authors.add('unknown')
|
||||
} else {
|
||||
// There is a git history, but the author is not known
|
||||
console.log({ email, author, slug })
|
||||
throw `Git author email ${email} is unknown in the git-to-author table`
|
||||
}
|
||||
} else authors.add(key)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue