Files
SGF/scripts/sgf-stock-catalogue-assets.mjs
2026-11-11 09:00:17 +02:00

3 lines
1.0 KiB
JavaScript

import fs from 'node:fs';import assert from 'node:assert/strict';import crypto from 'node:crypto';
const root=JSON.parse(fs.readFileSync('C:/laragon/data/sgf-tempo/run/modular-regression-current.json')).root+'/private/receipt-composition-cc50a276c10c',state=JSON.parse(fs.readFileSync(root+'/state.json')),manifest=JSON.parse(fs.readFileSync(state.app+'/public/build/manifest.json')),checks=[];for(const path of ['/sgf-stock-catalogue.mjs','/build/'+manifest['resources/js/app.jsx'].file]){const r=await fetch('http://127.0.0.1:8085'+path),bytes=Buffer.from(await r.arrayBuffer());assert.equal(r.status,200);assert.equal(crypto.createHash('sha256').update(bytes).digest('hex'),crypto.createHash('sha256').update(fs.readFileSync(state.app+'/public'+path)).digest('hex'));checks.push('HTTP installed asset exact '+path);}const file=root+'/stock-catalogue-assets-20261110.json';fs.writeFileSync(file,JSON.stringify({passed:true,checks,business_commands:0,browser_visual_review:false},null,2));console.log(JSON.stringify({passed:true,checks:checks.length,proof:file}));