fix: Allow slash icon with double release

This commit is contained in:
Eric Fennis
2023-09-11 09:07:14 +02:00
parent 55cb681461
commit a4076db69b
+8 -3
View File
@@ -1,8 +1,8 @@
/* eslint-disable no-restricted-syntax, no-await-in-loop */
import { simpleGit } from 'simple-git';
import semver from 'semver';
import fs from 'fs';
import path from 'path';
import { simpleGit } from 'simple-git';
import semver from 'semver';
import { readSvgDirectory } from './helpers.mjs';
const DATE_OF_FORK = '2020-06-08T16:39:52+0100';
@@ -15,6 +15,8 @@ const iconJsonFiles = readSvgDirectory(ICONS_DIR, '.json');
const location = path.resolve(currentDir, '.vitepress/data', 'releaseMetaData.json');
const releaseMetaDataDirectory = path.resolve(currentDir, '.vitepress/data', 'releaseMetadata');
const allowedIconNameWithDoubleRelease = ['slash'];
if (fs.existsSync(location)) {
fs.unlinkSync(location);
}
@@ -107,7 +109,10 @@ comparisons.forEach(({ tag, iconFiles, date } = {}) => {
}
if (status === 'A') {
if ('changedRelease' in newReleaseMetaData[iconName]) {
if (
'changedRelease' in newReleaseMetaData[iconName] &&
!allowedIconNameWithDoubleRelease.includes(iconName)
) {
throw new Error(`Icon '${iconName}' has already changedRelease set.`);
}