More robust handing of empty PLUGS list

pull/454/head
Zef Hemel 2023-07-04 16:52:43 +02:00
parent 56e1489a01
commit 5ff9a5692b
1 changed files with 7 additions and 0 deletions

View File

@ -13,6 +13,13 @@ export async function updatePlugsCommand() {
let plugList: string[] = [];
try {
const plugListRead: any[] = await readYamlPage("PLUGS");
if (!Array.isArray(plugListRead)) {
await editor.flashNotification(
"PLUGS YAML does not contain a plug list, not loading anything",
"error",
);
return;
}
plugList = plugListRead.filter((plug) => typeof plug === "string");
if (plugList.length !== plugListRead.length) {
throw new Error(