Skip to content

Commit

Permalink
Local existence check condition added
Browse files Browse the repository at this point in the history
  • Loading branch information
antonyagustine committed Jan 31, 2024
1 parent 49f4c45 commit cdc63b8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/contentstack-audit/src/modules/entries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,10 @@ export default class Entries {
const localesPath = join(localesFolderPath, this.config.moduleConfig.locales.fileName);
const masterLocalesPath = join(localesFolderPath, 'master-locale.json');
this.locales = existsSync(masterLocalesPath) ? values(JSON.parse(readFileSync(masterLocalesPath, 'utf8'))) : [];
this.locales.push(...values(JSON.parse(readFileSync(localesPath, 'utf8'))));

if (existsSync(localesPath)) {
this.locales.push(...values(JSON.parse(readFileSync(localesPath, 'utf8'))));
}

for (const { code } of this.locales) {
for (const { uid } of this.ctSchema) {
Expand Down

0 comments on commit cdc63b8

Please sign in to comment.