Skip to content

Commit

Permalink
fix: script error (#2085)
Browse files Browse the repository at this point in the history
  • Loading branch information
ST-DDT committed Apr 23, 2023
1 parent 8a0bbf5 commit 4ca3b75
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/generateLocales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,12 @@ for (const locale of locales) {
try {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const metadata: MetadataDefinitions = require(pathMetadata).default;
localeTitle = metadata.title;
if (!localeTitle) {
const { title } = metadata;
if (!title) {
throw new Error(`No title property found on ${JSON.stringify(metadata)}`);
}

localeTitle = title;
} catch (e) {
console.error(
`Failed to load ${pathMetadata}. Please make sure the file exists and exports MetadataDefinitions.`
Expand Down

0 comments on commit 4ca3b75

Please sign in to comment.