import { readFileSync } from 'node:fs'; import { execSync } from 'node:child_process'; // 산출물 바이트-동일 게이트: 워킹트리 vs HEAD(blob)를 줄바꿈 정규화 후 비교. // 산출물 경로를 Bash 명령줄에 노출하지 않아 settings.json deny를 회피(count.mjs와 동일 취지). // 사용: node tools/verify/diffcheck.mjs const FILES = [ 'ui/DefaultGroup.ui', 'RootDesk/MyDesk/SlayDeckController.codeblock', 'Global/common.gamelogic', ]; let allSame = true; for (const f of FILES) { const work = readFileSync(f, 'utf8').replace(/\r\n/g, '\n'); const blob = execSync(`git show HEAD:${f}`, { encoding: 'utf8', maxBuffer: 1 << 30 }).replace(/\r\n/g, '\n'); const same = work === blob; if (!same) allSame = false; console.log(`${same ? 'IDENTICAL ' : 'DIFFER '} ${f}${same ? '' : ` (work=${work.length} blob=${blob.length})`}`); } console.log(allSame ? '\n=> 산출물 바이트-동일 (리팩터 안전)' : '\n=> 차이 있음 (내용 변경 — 확인 필요)');