chore: deploy 触发分支改 master,竞品调研/原型/色板/i18n/分享组件/文档等成果入库
This commit is contained in:
1 parent
5a97e6124e
commit
40e2342a02
75 files changed
+6848
-540
No files matched your search
@@ -0,0 +1,21 @@
|
||||
const fs = require('fs');
|
||||
const p = 'D:/拼豆/taskboard/tasks.json';
|
||||
const db = JSON.parse(fs.readFileSync(p, 'utf8'));
|
||||
const TZ = 8 * 60 * 60 * 1000;
|
||||
function migrate(v) {
|
||||
if (typeof v === 'string' && /^\d{4}-\d{2}-\d{2}T[\d:.]+Z$/.test(v)) {
|
||||
const d = new Date(Date.parse(v) + TZ);
|
||||
return d.toISOString().replace('Z', '+08:00');
|
||||
}
|
||||
return v;
|
||||
}
|
||||
function walk(obj) {
|
||||
if (Array.isArray(obj)) { obj.forEach(walk); return; }
|
||||
if (obj && typeof obj === 'object') {
|
||||
for (const k of Object.keys(obj)) obj[k] = migrate(obj[k]);
|
||||
for (const k of Object.keys(obj)) if (obj[k] && typeof obj[k] === 'object') walk(obj[k]);
|
||||
}
|
||||
}
|
||||
walk(db);
|
||||
fs.writeFileSync(p, JSON.stringify(db, null, 2), 'utf8');
|
||||
console.log('migrated to +08:00, tasks:', db.tasks.length, 'agents:', Object.keys(db.agents || {}).length);
|
||||
Reference in new issue
Block a user