playwright/browser_patches/webkit/concat_protocol.js
Andrey Lushnikov 64a2940a0d
devops: fix webkit archiving (#4642)
Protocol concatenation script did not account for `WK_CHECKOUT_PATH`.
2020-12-08 16:32:45 -08:00

8 lines
448 B
JavaScript

const fs = require('fs');
const path = require('path');
const checkoutPath = process.env.WK_CHECKOUT_PATH || path.join(__dirname, 'checkout');
const protocolDir = path.join(checkoutPath, './Source/JavaScriptCore/inspector/protocol');
const files = fs.readdirSync(protocolDir).filter(f => f.endsWith('.json')).map(f => path.join(protocolDir, f));
const json = files.map(file => JSON.parse(fs.readFileSync(file)));
console.log(JSON.stringify(json));