Integration finished
This commit is contained in:
+29
-6
@@ -1,13 +1,36 @@
|
||||
const fs = require("fs");
|
||||
const util = require("node:util");
|
||||
const exec = util.promisify(require("node:child_process").exec);
|
||||
const readline = require("readline");
|
||||
|
||||
const outFile =
|
||||
"./PackageSources/html_ui/Pages/VCockpit/Instruments/aircraft_efb/TFDi_MD11_efb/efb.js";
|
||||
const outPath =
|
||||
"./PackageSources/html_ui/Pages/VCockpit/Instruments/aircraft_efb/TFDi_MD11_efb";
|
||||
|
||||
fs.copyFileSync("./efb.js", outFile);
|
||||
fs.copyFileSync("./EFB/efb.js", `${outPath}/efb.js`);
|
||||
fs.copyFileSync("./EFB/efb.html", `${outPath}/efb.html`);
|
||||
console.log("Files transferred.");
|
||||
|
||||
exec("git apply efb.patch").then(({stdout, stderr}) => {
|
||||
console.log("stdout:", stdout);
|
||||
console.error("stderr:", stderr);
|
||||
exec("git apply ./EFB/efb-js.patch").then(({ stdout, stderr }) => {
|
||||
console.log("Patches efb.js applied.");
|
||||
});
|
||||
exec("git apply ./EFB/efb-html.patch").then(({ stdout, stderr }) => {
|
||||
console.log("Patches efb.html applied.");
|
||||
});
|
||||
|
||||
var output = "";
|
||||
var lineReader = readline.createInterface({
|
||||
input: fs.createReadStream(`${outPath}/App.js`),
|
||||
});
|
||||
lineReader.on("line", (line) => {
|
||||
if (line.startsWith("import") || line.startsWith("export")) {
|
||||
output += "// " + line + "\n";
|
||||
} else {
|
||||
output += line + "\n";
|
||||
}
|
||||
});
|
||||
lineReader.on("close", () => {
|
||||
fs.writeFile(`${outPath}/App.js`, output, (err) => {
|
||||
if (err) console.log(err);
|
||||
console.log("Import/Export removed.");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user