mirror of
https://github.com/Dvorinka/excalidraw-full.git
synced 2026-06-04 06:12:56 +00:00
338dbcc20e
- Remove stale cloudflare-worker submodule entry from .gitmodules - Remove .git dirs from cf-kv and excalidraw-libraries so Git tracks them as regular files - Fixes 'No url found for submodule path cf-kv' CI error
24 lines
557 B
JavaScript
24 lines
557 B
JavaScript
import { readFile, writeFile } from "fs/promises";
|
|
|
|
const PATH_LIBRARIES = "./libraries.json";
|
|
|
|
const libraries = JSON.parse(await readFile(PATH_LIBRARIES, "utf8"));
|
|
|
|
for (const lib of libraries) {
|
|
if (lib.version === 1) {
|
|
continue;
|
|
}
|
|
|
|
const libraryData = JSON.parse(
|
|
await readFile(`libraries/` + lib.source, "utf8"),
|
|
);
|
|
lib.itemNames = libraryData.libraryItems.reduce((acc, item) => {
|
|
if (item.name) {
|
|
acc.push(item.name);
|
|
}
|
|
return acc;
|
|
}, []);
|
|
}
|
|
|
|
await writeFile(PATH_LIBRARIES, JSON.stringify(libraries, null, 2));
|