Quietly ignore ELI symlinks

This commit is contained in:
Emmanuel 2024-07-16 10:54:37 +02:00
parent ad96dacf54
commit abd9b00e59
2 changed files with 14 additions and 0 deletions

View file

@ -185,6 +185,13 @@ async function importJorf(
const filePath = path.join(dataDir, relativePath) const filePath = path.join(dataDir, relativePath)
if (!filePath.endsWith(".xml")) { if (!filePath.endsWith(".xml")) {
if (
filePath.includes("/eli/") &&
(await fs.lstat(filePath)).isSymbolicLink()
) {
// Ignore ELI symbolic links, because the name of the link is present in TexteVersion.
continue
}
console.info(`Skipping non XML file at ${filePath}`) console.info(`Skipping non XML file at ${filePath}`)
continue continue
} }

View file

@ -170,6 +170,13 @@ async function importLegi(
const filePath = path.join(dataDir, relativePath) const filePath = path.join(dataDir, relativePath)
if (!filePath.endsWith(".xml")) { if (!filePath.endsWith(".xml")) {
if (
filePath.includes("/eli/") &&
(await fs.lstat(filePath)).isSymbolicLink()
) {
// Ignore ELI symbolic links, because the name of the link is present in TexteVersion.
continue
}
console.info(`Skipping non XML file at ${filePath}`) console.info(`Skipping non XML file at ${filePath}`)
continue continue
} }