gen-screenshot: replace deprecated `Deno.run`

This commit is contained in:
D. Bohdan 2024-02-06 18:46:50 +00:00
parent 49b213e66f
commit fdf78ba150
1 changed files with 20 additions and 15 deletions

View File

@ -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 {