forked from Akanimoh12/Stellar-Tipz
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfix-contrast.js
More file actions
25 lines (22 loc) · 919 Bytes
/
Copy pathfix-contrast.js
File metadata and controls
25 lines (22 loc) · 919 Bytes
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
const fs = require('fs');
const path = require('path');
function walkDir(dir, callback) {
fs.readdirSync(dir).forEach(f => {
let dirPath = path.join(dir, f);
let isDirectory = fs.statSync(dirPath).isDirectory();
isDirectory ? walkDir(dirPath, callback) : callback(path.join(dir, f));
});
}
const targetDir = path.join(__dirname, 'frontend-scaffold', 'src');
walkDir(targetDir, function(filePath) {
if (filePath.endsWith('.tsx') || filePath.endsWith('.ts') || filePath.endsWith('.jsx')) {
let content = fs.readFileSync(filePath, 'utf8');
let replaced = content.replace(/text-gray-400/g, 'text-gray-700 dark:text-gray-300');
replaced = replaced.replace(/text-gray-500/g, 'text-gray-800 dark:text-gray-200');
if (content !== replaced) {
fs.writeFileSync(filePath, replaced, 'utf8');
console.log(`Updated ${filePath}`);
}
}
});
console.log("Contrast fixes applied.");