diff --git a/.gulp/tasks/icons-accents.ts b/.gulp/tasks/icons-accents.ts index 04eef61..dee9cf8 100644 --- a/.gulp/tasks/icons-accents.ts +++ b/.gulp/tasks/icons-accents.ts @@ -42,13 +42,17 @@ function replaceNameWithAccent(name: string, accentName: string): string { * @returns {string} */ export function replaceSVGColour(filecontent: string, colour: string): string { - return filecontent.replace(new RegExp('.st0\{fill:\s{0,}#([a-zA-Z0-9]{6})\}|path fill="#([a-zA-Z0-9]{6})"'), ($0, $1, $2) => { + return filecontent.replace(new RegExp('.st0\{fill:\s{0,}#([a-zA-Z0-9]{6})|path fill="#([a-zA-Z0-9]{6})"'), ($0, $1, $2) => { colour = colour.replace('#', ''); if (!$2) { + console.log(`Replacing colour ${ $1 } with ${ colour }`) + return $0.replace($1, colour); } else { + console.log(`Replacing colour ${ $2 } with ${ colour }`) + return $0.replace($2, colour); } });