This commit is contained in:
1 parent
f80e901b21
commit
c14493c00f
3 files changed
+28
-1
No files matched your search
@@ -86,6 +86,7 @@ function makeUniqueAbbrlink(seed, usedAbbrlinks) {
|
||||
async function main() {
|
||||
const files = await listMarkdownFiles(POSTS_DIR);
|
||||
const usedAbbrlinks = new Set();
|
||||
const existingFiles = new Map();
|
||||
const pending = [];
|
||||
|
||||
for (const file of files) {
|
||||
@@ -97,6 +98,10 @@ async function main() {
|
||||
const existing = getScalar(frontmatterLines, 'abbrlink');
|
||||
|
||||
if (existing) {
|
||||
if (existingFiles.has(existing)) {
|
||||
throw new Error(`Duplicate abbrlink "${existing}" in ${relative(process.cwd(), existingFiles.get(existing))} and ${relative(process.cwd(), file)}`);
|
||||
}
|
||||
existingFiles.set(existing, file);
|
||||
usedAbbrlinks.add(existing);
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user