From fdf78ba1500bbb605fcaade17d559be2ba6f5a56 Mon Sep 17 00:00:00 2001 From: "D. Bohdan" Date: Tue, 6 Feb 2024 18:46:50 +0000 Subject: [PATCH] gen-screenshot: replace deprecated `Deno.run` --- gen-screenshot.ts | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/gen-screenshot.ts b/gen-screenshot.ts index e5289e4..2311690 100755 --- a/gen-screenshot.ts +++ b/gen-screenshot.ts @@ -49,21 +49,24 @@ try { `screenshot/${screenshotFile}`, ); - await Deno.run({ - cmd: [ - "convert", - "-resize", - "25%", - "-adaptive-sharpen", - "10", - `screenshot/${screenshotFile}`, - `thumbnail/${screenshotFile}`, - ], - }).status(); + await (new Deno.Command( + "convert", + { + args: [ + "-resize", + "25%", + "-adaptive-sharpen", + "10", + `screenshot/${screenshotFile}`, + `thumbnail/${screenshotFile}`, + ], + stderr: "inherit", + stdout: "inherit", + }, + )).output(); - await Deno.run({ - cmd: [ - "optipng", + await (new Deno.Command("optipng", { + args: [ "-o", "5", "-strip", @@ -71,7 +74,9 @@ try { `screenshot/${screenshotFile}`, `thumbnail/${screenshotFile}`, ], - }).status(); + stderr: "inherit", + stdout: "inherit", + })).output(); } catch (err) { console.error(err); } finally {