diff --git a/comment-markup.md b/comment-markup.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/scripts/generateChangedIconsCommentMarkup.mjs b/scripts/generateChangedIconsCommentMarkup.mjs index 8d32dae94b..8b69fceff1 100644 --- a/scripts/generateChangedIconsCommentMarkup.mjs +++ b/scripts/generateChangedIconsCommentMarkup.mjs @@ -15,11 +15,21 @@ const BASE_URL = 'https://lucide.dev/api/gh-icon'; const changedFilesPathString = process.env.CHANGED_FILES; +if (changedFilesPathString == null) { + console.error('CHANGED_FILES env variable is not set'); + process.exit(1); +} + const changedFiles = changedFilesPathString .split(' ') .map((file) => file.replace('.json', '.svg')) .filter((file, idx, arr) => arr.indexOf(file) === idx); +if (changedFiles.length === 0) { + console.log('No changed icons found'); + process.exit(0); +} + const getImageTagsByFiles = (files, getBaseUrl, width) => files.map((file) => { const svgContent = fs.readFileSync(path.join(process.cwd(), file), 'utf-8');