From 9837da4b7ba6d2ec590a72859383c0424036eb1e Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 18 Jun 2022 17:23:40 -0300 Subject: try friendlily harder to get ImageMagick to work --- src/util/node-utils.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/util') diff --git a/src/util/node-utils.js b/src/util/node-utils.js index a46d614..ad87cae 100644 --- a/src/util/node-utils.js +++ b/src/util/node-utils.js @@ -2,6 +2,15 @@ import { fileURLToPath } from 'url'; +import _commandExists from 'command-exists'; + +// This package throws an error instead of returning false when the command +// doesn't exist, for some reason. Yay for making logic more difficult! +// Here's a straightforward workaround. +export function commandExists(command) { + return _commandExists(command).then(() => true, () => false); +} + // Very cool function origin8ting in... http-music pro8a8ly! // Sorry if we happen to 8e violating past-us's copyright, lmao. export function promisifyProcess(proc, showLogging = true) { -- cgit 1.3.0-6-gf8a5