// Helper for docker-prep.sh — inject pnpm.overrides for @bytelyst/* tarballs.
// Reads: PKG_FILE_ARG (path), OVERRIDES_ARG (JSON object string)
// Writes: $PKG_FILE_ARG in place
const fs = require('fs');
const f = process.env.PKG_FILE_ARG;
const p = JSON.parse(fs.readFileSync(f, 'utf8'));
p.pnpm = p.pnpm || {};
p.pnpm.overrides = Object.assign({}, p.pnpm.overrides || {}, JSON.parse(process.env.OVERRIDES_ARG));
fs.writeFileSync(f, JSON.stringify(p, null, 2) + '\n');
