Replace YAML parser

This commit is contained in:
Zef Hemel
2023-11-29 16:51:28 +01:00
parent 62e98b1fd8
commit 1d5c6f9277
9 changed files with 55 additions and 12 deletions
+4 -1
View File
@@ -25,6 +25,9 @@ export async function publishCommand() {
}
async function publish(pageName: string, uris: string[]) {
const broadcastResults = await events.dispatchEvent(`share:_`, {
name: pageName,
} as PublishEvent);
for (const uri of uris) {
const publisher = uri.split(":")[0];
const results = await events.dispatchEvent(
@@ -34,7 +37,7 @@ async function publish(pageName: string, uris: string[]) {
name: pageName,
} as PublishEvent,
);
if (results.length === 0) {
if (broadcastResults.length === 0 && results.length === 0) {
throw new Error(`Unsupported publisher: ${publisher} for URI: ${uri}`);
}
}