From 2102fcdd887f271602068c98b26e63b709188c29 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 15 Feb 2026 09:58:29 +0000 Subject: [PATCH] fix(ci): robustly exclude webtorrent.min.js from hex check Co-authored-by: PR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> --- scripts/check-hex.js | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/scripts/check-hex.js b/scripts/check-hex.js index ee1a56b3..21126906 100755 --- a/scripts/check-hex.js +++ b/scripts/check-hex.js @@ -35,7 +35,8 @@ const IGNORED_GLOBS = [ 'releases/**', 'bitvid-working-webtorrent/**', 'scripts/agent/**', - 'docs/capacitor-native-app-plan.md' + 'docs/capacitor-native-app-plan.md', + '**/webtorrent.min.js' ]; const gitArgs = [ @@ -68,10 +69,22 @@ if (result.error) { // 2+ on errors. if (result.status === 0 && result.stdout.trim()) { - console.error('Hex colors detected outside tokens or SVG assets:'); - console.error(result.stdout.trimEnd()); - console.error('\nAllowed exceptions: tokens (css/tokens.css) and vector logos (*.svg).'); - process.exit(1); + const lines = result.stdout.split('\n'); + const filteredLines = lines.filter(line => { + // Robustly ignore webtorrent.min.js even if git exclusions fail + if (line.includes('webtorrent.min.js')) return false; + return line.trim().length > 0; + }); + + if (filteredLines.length > 0) { + console.error('Hex colors detected outside tokens or SVG assets:'); + console.error(filteredLines.join('\n')); + console.error('\nAllowed exceptions: tokens (css/tokens.css) and vector logos (*.svg).'); + process.exit(1); + } else { + // All matches were ignored + process.exit(0); + } } if (result.status && result.status !== 1) {