We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6c5cba4 commit a6c1754Copy full SHA for a6c1754
1 file changed
tasks/gen-wcwidth.ts
@@ -412,5 +412,14 @@ int wcwidth(uint32_t codepoint) {
412
int iswprint(uint32_t codepoint) { return wcwidth(codepoint) >= 0; }
413
`;
414
415
-await Deno.writeTextFile("src/wcwidth.c", output);
416
-console.error("Wrote src/wcwidth.c");
+if (Deno.args.includes("--check")) {
+ const existing = await Deno.readTextFile("src/wcwidth.c");
417
+ if (existing !== output) {
418
+ console.error("src/wcwidth.c is out of date — run: deno task gen-wcwidth");
419
+ Deno.exit(1);
420
+ }
421
+ console.error("src/wcwidth.c is up to date");
422
+} else {
423
+ await Deno.writeTextFile("src/wcwidth.c", output);
424
+ console.error("Wrote src/wcwidth.c");
425
+}
0 commit comments