Merge pull request #54 from Willyfrog/yaml-ignore-bad-plugs

Improve error on formating plug sections
pull/66/head
Zef Hemel 2022-07-29 21:16:59 +02:00 committed by GitHub
commit 3fed032e72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -38,7 +38,11 @@ export async function updatePlugsCommand() {
export async function updatePlugs() {
let plugList: string[] = [];
try {
plugList = await readYamlPage("PLUGS");
const plugListRead: any[] = await readYamlPage("PLUGS");
plugList = plugListRead.filter((plug) => typeof plug === 'string');
if (plugList.length !== plugListRead.length) {
throw new Error(`Some of the plugs were not in a yaml list format, they were ignored`);
}
} catch (e: any) {
throw new Error(`Error processing PLUGS: ${e.message}`);
}