Skip to content

Commit

Permalink
fix: don't pipe stderr to stdout (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats authored Sep 15, 2024
1 parent 6425173 commit 6b6b4cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 (_) {}
})()

Expand Down

0 comments on commit 6b6b4cb

Please sign in to comment.