Adj. to 103
This commit is contained in:
+10
-9
@@ -1,3 +1,4 @@
|
||||
const { applyPatch } = require("diff");
|
||||
const fs = require("fs");
|
||||
const util = require("node:util");
|
||||
const exec = util.promisify(require("node:child_process").exec);
|
||||
@@ -6,17 +7,17 @@ const readline = require("readline");
|
||||
const outPath =
|
||||
"./PackageSources/html_ui/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb";
|
||||
|
||||
fs.copyFileSync("./EFB/efb.js", `${outPath}/efb.js`);
|
||||
fs.copyFileSync("./EFB/efb.html", `${outPath}/efb.html`);
|
||||
fs.copyFileSync("./EFB/efb.css", `${outPath}/efb.css`);
|
||||
console.log("Files transferred.");
|
||||
|
||||
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.");
|
||||
});
|
||||
let file1Contents = fs.readFileSync("./EFB/efb.js").toString();
|
||||
let patch = fs.readFileSync("./EFB/efb-js.patch").toString();
|
||||
let patchedFile = applyPatch(file1Contents, patch);
|
||||
fs.writeFileSync(`${outPath}/efb.js`, patchedFile);
|
||||
|
||||
file1Contents = fs.readFileSync("./EFB/efb.html").toString();
|
||||
patch = fs.readFileSync("./EFB/efb-html.patch").toString();
|
||||
patchedFile = applyPatch(file1Contents, patch);
|
||||
fs.writeFileSync(`${outPath}/efb.html`, patchedFile);
|
||||
|
||||
var output = "";
|
||||
var lineReader = readline.createInterface({
|
||||
|
||||
Reference in New Issue
Block a user