reset(archicrat-ia): canonical docx import and anchors baseline
This commit is contained in:
@@ -205,12 +205,28 @@ async function main() {
|
||||
const manifestPath = path.resolve(args.manifest);
|
||||
|
||||
const items = await readManifest(manifestPath);
|
||||
const selected = args.all ? items : items.filter(it => args.only.includes(it.slug));
|
||||
const selected = args.all
|
||||
? items
|
||||
: items.filter((it) => {
|
||||
const rawSlug = String(it.slug || "").trim();
|
||||
const rawCollection = String(it.collection || "").trim();
|
||||
const qualified = `${rawCollection}/${rawSlug}`;
|
||||
return args.only.includes(rawSlug) || args.only.includes(qualified);
|
||||
});
|
||||
|
||||
if (!args.all && selected.length !== args.only.length) {
|
||||
const found = new Set(selected.map(s => s.slug));
|
||||
const missing = args.only.filter(s => !found.has(s));
|
||||
throw new Error(`Some --only slugs not found in manifest: ${missing.join(", ")}`);
|
||||
if (!args.all) {
|
||||
const found = new Set(
|
||||
selected.flatMap((s) => {
|
||||
const rawSlug = String(s.slug || "").trim();
|
||||
const rawCollection = String(s.collection || "").trim();
|
||||
return [rawSlug, `${rawCollection}/${rawSlug}`];
|
||||
})
|
||||
);
|
||||
|
||||
const missing = args.only.filter((s) => !found.has(s));
|
||||
if (missing.length > 0) {
|
||||
throw new Error(`Some --only slugs not found in manifest: ${missing.join(", ")}`);
|
||||
}
|
||||
}
|
||||
|
||||
const pandocOk = havePandoc();
|
||||
|
||||
Reference in New Issue
Block a user