纠正仓库内容为衍生项目,标明 campaign-200-r2 最新版

This commit is contained in:
toshiocn
2026-10-19 16:56:31 +08:00
parent a492c5b80e
commit fdca4f67ea
1396 changed files with 392768 additions and 19530 deletions
+9
View File
@@ -0,0 +1,9 @@
import fs from 'node:fs';import path from 'node:path';import crypto from 'node:crypto';import {fileURLToPath} from 'node:url';
const root=path.resolve(path.dirname(fileURLToPath(import.meta.url)),'..'),source='G:\\项目\\NumberSwipe';
const before=JSON.parse(fs.readFileSync(path.join(root,'reports','original-before.json'),'utf8').replace(/^\uFEFF/,''));
const hash=file=>crypto.createHash('sha256').update(fs.readFileSync(file)).digest('hex').toUpperCase();
const current=[];function walk(dir){for(const item of fs.readdirSync(dir,{withFileTypes:true})){if(item.isDirectory()&&['.git','node_modules'].includes(item.name))continue;const full=path.join(dir,item.name);if(item.isDirectory())walk(full);else if(item.isFile())current.push(full);}}walk(source);
const expected=new Set(before.map(r=>r.path)),changed=[],missing=[];for(const item of before){if(!fs.existsSync(item.path))missing.push(item.path);else if(hash(item.path)!==item.hash)changed.push(item.path);}const added=current.filter(p=>!expected.has(p));
const report={checkedAt:new Date().toISOString(),source,checkedFiles:before.length,changed,missing,added,unchanged:!changed.length&&!missing.length&&!added.length,excluded:['.git','node_modules']};fs.writeFileSync(path.join(root,'reports','isolation.json'),JSON.stringify(report,null,2));
fs.writeFileSync(path.join(root,'reports','ISOLATION.md'),`# 原项目隔离校验\n\n核对 ${before.length} 个原项目文件的SHA-256与文件清单。\n\n修改 ${changed.length},删除 ${missing.length},新增 ${added.length}。\n\n${report.unchanged?'通过:原项目受检查文件全部保持一致。':'检测到外部修改,请查看isolation.json。'}\n\n.git与node_modules未纳入内容遍历;本任务未执行原项目Git写入或依赖操作。所有任务输出都在NumberSwipe-Variants。\n`);
console.log(JSON.stringify(report));if(!report.unchanged)process.exitCode=1;