Skip to content

Commit

Permalink
gulp: Fixed changes task
Browse files Browse the repository at this point in the history
This fixes an issue in the changes task where removed languages were
causing a property access on `undefined`.
  • Loading branch information
RunDevelopment committed Dec 18, 2019
1 parent 7a4a0c7 commit 2f49590
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions gulpfile.js/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const revisionRanges = {
const strCompare = (a, b) => a.localeCompare(b, 'en');

async function changes() {
const { languages, plugins } = require('../components');
const { languages, plugins } = require('../components.js');

const infos = await getLog(revisionRanges.nextRelease);

Expand Down Expand Up @@ -225,9 +225,12 @@ async function changes() {
const change = relevantChanges[0];
if (change.mode === 'A' && change.file.startsWith('components/prism-')) {
const lang = change.file.match(/prism-([\w-]+)\.js$/)[1];
const titles = [languages[lang].title];
if (languages[lang].aliasTitles) {
titles.push(...Object.values(languages[lang].aliasTitles));
const entry = languages[lang] || {
title: "REMOVED LANGUAGE " + lang,
};
const titles = [entry.title];
if (entry.aliasTitles) {
titles.push(...Object.values(entry.aliasTitles));
}
addEntry('New components', `__${titles.join('__ & __')}__: ${infoToString(info)}`);
return true;
Expand Down

0 comments on commit 2f49590

Please sign in to comment.