Skip to content

Commit

Permalink
fix: Allow slash icon with double release
Browse files Browse the repository at this point in the history
  • Loading branch information
ericfennis committed Sep 11, 2023
1 parent d244205 commit 36eac9d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/writeReleaseMetadata.mjs
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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);
}
Expand Down Expand Up @@ -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.`);
}

Expand Down

0 comments on commit 36eac9d

Please sign in to comment.