Import createPatch in ts/sql_format directly

This commit is contained in:
Henrik Giesel 2021-04-22 18:43:35 +02:00
parent a7c3aec5dc
commit 5a11566ff2

View file

@ -2,7 +2,7 @@
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html // License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import sqlFormatter from "@sqltools/formatter"; import sqlFormatter from "@sqltools/formatter";
import * as Diff from "diff"; import { createPatch } from "diff";
import process from "process"; import process from "process";
import path from "path"; import path from "path";
import fs from "fs"; import fs from "fs";
@ -38,7 +38,7 @@ for (const path of process.argv.slice(2)) {
errorFound = true; errorFound = true;
console.log("SQL formatting issues found:"); console.log("SQL formatting issues found:");
} }
console.log(Diff.createPatch(path, orig, formatted)); console.log(createPatch(path, orig, formatted));
} }
} }
} }