const { createTwoFilesPatch } = require("diff");
const fs = require("fs");

// HTML

let file1Contents = fs.readFileSync("EFB.html").toString();
let file2Contents = fs.readFileSync("patched/EFB.html").toString();
let patch = createTwoFilesPatch(
  "EFB.html",
  "EFB.html",
  file1Contents,
  file2Contents
);
fs.writeFileSync("efb-html.patch", patch);

// JS

file1Contents = fs.readFileSync("EFB.index.js").toString();
file2Contents = fs.readFileSync("patched/EFB.index.js").toString();
patch = createTwoFilesPatch("EFB.index.js", "EFB.index.js", file1Contents, file2Contents);
fs.writeFileSync("efb-index-js.patch", patch);

file1Contents = fs.readFileSync("EFB.js").toString();
file2Contents = fs.readFileSync("patched/EFB.js").toString();
patch = createTwoFilesPatch("EFB.js", "EFB.js", file1Contents, file2Contents);
fs.writeFileSync("efb-js.patch", patch);
