Skip to content

Commit 4ca3b75

Browse files
authored
fix: script error (#2085)
1 parent 8a0bbf5 commit 4ca3b75

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

scripts/generateLocales.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,12 @@ for (const locale of locales) {
282282
try {
283283
// eslint-disable-next-line @typescript-eslint/no-var-requires
284284
const metadata: MetadataDefinitions = require(pathMetadata).default;
285-
localeTitle = metadata.title;
286-
if (!localeTitle) {
285+
const { title } = metadata;
286+
if (!title) {
287287
throw new Error(`No title property found on ${JSON.stringify(metadata)}`);
288288
}
289+
290+
localeTitle = title;
289291
} catch (e) {
290292
console.error(
291293
`Failed to load ${pathMetadata}. Please make sure the file exists and exports MetadataDefinitions.`

0 commit comments

Comments
 (0)