From 80f3bc3b45c6a387fe0154935e637c17d0342de1 Mon Sep 17 00:00:00 2001 From: Kiko Beats Date: Sun, 15 Sep 2024 12:05:44 +0000 Subject: [PATCH] fix: don't pipe stderr to stdout --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index b8ed018..f96d5fa 100644 --- a/src/index.js +++ b/src/index.js @@ -57,7 +57,7 @@ const fetch = PCancelable.fn( if (mutoolPath && contentType === 'application/pdf') { const file = getTemporalFile(url, 'pdf') await writeFile(file.path, res.body) - return (await $(`mutool draw -q -F html ${file.path}`)).stdout + return (await $(`${mutoolPath} draw -q -F html ${file.path}`)).stdout } return contentType.startsWith('text/html') || !isMediaUrl(url) @@ -191,7 +191,7 @@ const defaultGetTemporalFile = (url, ext) => { const defaultMutoolPath = () => (() => { try { - return execSync('which mutool').toString().trim() + return execSync('which mutool', { stdio: 'pipe' }).toString().trim() } catch (_) {} })()