mirror of
https://github.com/coder/code-server.git
synced 2025-07-31 14:04:06 +08:00
Replace jq with some JavaScript
This commit is contained in:
18
scripts/merge.js
Normal file
18
scripts/merge.js
Normal file
@ -0,0 +1,18 @@
|
||||
const fs = require("fs");
|
||||
|
||||
const a = process.argv[2];
|
||||
const b = process.argv[3];
|
||||
const out = process.argv[4];
|
||||
|
||||
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,
|
||||
}, null, 2));
|
Reference in New Issue
Block a user