1
0
mirror of https://github.com/coder/code-server.git synced 2024-12-05 07:13:06 +08:00
code-server/scripts/merge.js
2019-07-18 18:08:37 -05:00

21 lines
454 B
JavaScript

const fs = require("fs");
const a = process.argv[2];
const b = process.argv[3];
const out = process.argv[4];
const json = JSON.parse(process.argv[5] || "{}");
const aJson = JSON.parse(fs.readFileSync(a));
const bJson = JSON.parse(fs.readFileSync(b));
delete aJson.scripts;
delete aJson.dependencies;
delete aJson.devDependencies;
delete aJson.optionalDependencies;
fs.writeFileSync(out, JSON.stringify({
...aJson,
...bJson,
...json,
}, null, 2));