cmd -> command

This commit is contained in:
Nycki 2024-11-30 19:37:11 -08:00
parent 360dc2b055
commit d209608106

View file

@ -13,14 +13,14 @@ async function main() {
const fileOut = `${dirOut}/${file.name}.webp`; const fileOut = `${dirOut}/${file.name}.webp`;
const lossless = file.ext === '.png'; const lossless = file.ext === '.png';
const cmd = [ const command = [
`magick "${fileIn}"`, `magick "${fileIn}"`,
`-define webp:lossless=${lossless}`, `-define webp:lossless=${lossless}`,
`-define webp:target-size=200kb`, `-define webp:target-size=200kb`,
`"${fileOut}"`, `"${fileOut}"`,
].join(' '); ].join(' ');
console.log(cmd); console.log(command);
exec(cmd, (_err, stdout, stderr) => console.log(stdout + stderr)); exec(command, (_err, stdout, stderr) => console.log(stdout + stderr));
} }
} }