2019-07-03 07:10:17 +07:00
|
|
|
const { Binary } = require("@coder/nbin");
|
|
|
|
const fs = require("fs");
|
|
|
|
const path = require("path");
|
|
|
|
|
2019-08-03 07:26:41 +07:00
|
|
|
const source = process.argv[2];
|
|
|
|
const target = process.argv[3];
|
|
|
|
const binaryName = process.argv[4];
|
2019-07-03 07:10:17 +07:00
|
|
|
|
|
|
|
const bin = new Binary({
|
|
|
|
mainFile: path.join(source, "out/vs/server/main.js"),
|
|
|
|
target: target,
|
|
|
|
});
|
|
|
|
|
|
|
|
bin.writeFiles(path.join(source, "**"));
|
|
|
|
|
|
|
|
bin.build().then((binaryData) => {
|
2019-08-03 07:26:41 +07:00
|
|
|
const outputPath = path.join(source, binaryName);
|
2019-07-03 07:10:17 +07:00
|
|
|
fs.writeFileSync(outputPath, binaryData);
|
|
|
|
fs.chmodSync(outputPath, "755");
|
|
|
|
}).catch((ex) => {
|
|
|
|
console.error(ex);
|
|
|
|
process.exit(1);
|
|
|
|
});
|