初始化仓库
初始化仓库
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
const fs = require('fs');
|
||||
const files = [
|
||||
'src/post.html',
|
||||
'src/index.html',
|
||||
'src/header-menu.html',
|
||||
'src/category.html',
|
||||
'src/user-menu.html'
|
||||
];
|
||||
let total = 0;
|
||||
for (const f of files) {
|
||||
let c = fs.readFileSync(f, 'utf8');
|
||||
const before = c;
|
||||
c = c.replace(/([\w.]+) != ([\w]+)/g, 'not ($1 == $2)');
|
||||
if (c !== before) {
|
||||
fs.writeFileSync(f, c);
|
||||
const diff = (before.match(/!=/g) || []).length;
|
||||
console.log('✓', f, '替换', diff, '处');
|
||||
total += diff;
|
||||
}
|
||||
}
|
||||
console.log('共替换', total, '处');
|
||||
Reference in New Issue
Block a user