Skip to content

Commit

Permalink
fix: ensure module manifest doesn't reference template module name
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Dec 6, 2023
1 parent 79f042b commit af517e4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ export { ModuleManifest, ModuleManifestMaintainer, ModuleManifestRuntime }

/** Validate that a manifest looks correctly populated */
export function validateManifest(manifest: ModuleManifest): void {
const manifestStr = JSON.stringify(manifest)
if (manifestStr.includes('companion-module-your-module-name'))
throw new Error(`Manifest incorrectly references template module 'companion-module-your-module-name'`)

if (!validateManifestSchema(manifest)) {
const errors = validateManifestSchema.errors
if (!errors) throw new Error(`Manifest failed validation with unknown reason`)
Expand Down

0 comments on commit af517e4

Please sign in to comment.