-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfont-fix.js
32 lines (28 loc) · 944 Bytes
/
font-fix.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const fs = require('fs');
function fixFontPath(filename) {
if (fs.existsSync(filename)) {
const content = fs.readFileSync(filename, 'utf8');
let quote = '"';
if (/@fontPath\s*:\s*'/.test(content)) {
quote = "'";
}
fs.writeFileSync(
filename,
content.replace(
/@fontPath\s*:\s*("|')\.{2}\/\.{2}\/themes\//g,
`@fontPath : ${quote}../../`
),
'utf8'
);
} else {
console.warn(`${filename} does not exist`);
}
}
[
'semantic/src/themes/basic/elements/icon.variables',
'semantic/src/themes/default/globals/site.variables',
'semantic/src/themes/flat/globals/site.variables',
'semantic/src/themes/github/elements/icon.variables',
'semantic/src/themes/material/elements/icon.variables',
'semantic/src/themes/material/globals/site.variables',
].forEach(fixFontPath);