diff --git a/scripts/merge.js b/scripts/merge.js new file mode 100644 index 000000000..61bfb7d4b --- /dev/null +++ b/scripts/merge.js @@ -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)); diff --git a/scripts/package.json b/scripts/package.json index 234792c36..5085fa85b 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -1,3 +1,5 @@ { - "name": "code-server" + "name": "code-server", + "main": "out/vs/server/main", + "desktopName": "code-server-url-handler.desktop" } diff --git a/scripts/tasks.bash b/scripts/tasks.bash index f430c1a50..e96c413f9 100755 --- a/scripts/tasks.bash +++ b/scripts/tasks.bash @@ -68,8 +68,8 @@ function build-code-server() { mkdir -p "${codeServerBuildPath}" cp -r "${vscodeBuildPath}/resources/app/extensions" "${codeServerBuildPath}" - jq -s '.[0] * .[1]' "${vscodeBuildPath}/resources/app/package.json" "${rootPath}/scripts/package.json" > "${codeServerBuildPath}/package.json" - jq -s '.[0] * .[1]' "${vscodeBuildPath}/resources/app/product.json" "${rootPath}/scripts/product.json" > "${codeServerBuildPath}/product.json" + node "${rootPath}/scripts/merge.js" "${vscodeBuildPath}/resources/app/package.json" "${rootPath}/scripts/package.json" "${codeServerBuildPath}/package.json" + node "${rootPath}/scripts/merge.js" "${vscodeBuildPath}/resources/app/product.json" "${rootPath}/scripts/product.json" "${codeServerBuildPath}/product.json" cp -r "${vscodeSourcePath}/out" "${codeServerBuildPath}" rm -rf "${codeServerBuildPath}/out/vs/server/node_modules" cp -r "${vscodeSourcePath}/remote/node_modules" "${codeServerBuildPath}"