This commit is contained in:
JOLIMAITRE Matthieu 2023-01-20 08:29:23 +01:00
commit ab055ed8fc
11 changed files with 197 additions and 0 deletions

12
lib/utils.ts Normal file
View file

@ -0,0 +1,12 @@
export function decode(input: Uint8Array): string {
return new TextDecoder().decode(input);
}
export async function show_diff(a: string, b: string) {
const [path_a, path_b] = ["/tmp/diff_a", "/tmp/diff_b"];
await Deno.writeTextFile(path_a, a);
await Deno.writeTextFile(path_b, b);
await Deno.run({ cmd: ["diff", path_a, path_b] }).status();
await Deno.remove(path_a);
await Deno.remove(path_b);
}