docs: 한글화 운영 적용본과 도움말 100개 작업 기록 보관
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import fs from 'node:fs';
|
||||
import crypto from 'node:crypto';
|
||||
import path from 'node:path';
|
||||
const root=path.dirname(new URL(import.meta.url).pathname.replace(/^\/([A-Za-z]:\/)/,'$1'));
|
||||
const hash=b=>crypto.createHash('sha256').update(b).digest('hex');
|
||||
const manifest=path.join(root,'SHA256SUMS.json');
|
||||
const files=fs.readdirSync(root,{recursive:true}).filter(p=>fs.statSync(path.join(root,p)).isFile()&&p!=='SHA256SUMS.json').sort();
|
||||
const entries=Object.fromEntries(files.map(p=>{const b=fs.readFileSync(path.join(root,p));return[p.replaceAll('\\','/'),{bytes:b.length,sha256:hash(b)}]}));
|
||||
if(process.argv.includes('--write'))fs.writeFileSync(manifest,JSON.stringify(entries,null,2)+'\n');
|
||||
else {
|
||||
const expected=JSON.parse(fs.readFileSync(manifest));
|
||||
const errors=Object.keys(expected).filter(p=>!entries[p]||entries[p].sha256!==expected[p].sha256);
|
||||
if(errors.length)throw Error('Snapshot mismatch: '+errors.join(', '));
|
||||
}
|
||||
console.log(JSON.stringify({files:files.length,bytes:Object.values(entries).reduce((n,e)=>n+e.bytes,0),status:'verified'}));
|
||||
Reference in New Issue
Block a user