Skip to content

Commit

Permalink
Output error message directly
Browse files Browse the repository at this point in the history
  • Loading branch information
1000ch committed Nov 11, 2021
1 parent a9c554a commit b80c567
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ bin.run(['--version']).then(() => {
console.warn('pngquant pre-build test failed');
console.info('compiling from source');

const libpng = process.platform === 'darwin' ? 'libpng' : 'libpng-dev';

try {
const source = fileURLToPath(new URL('../vendor/source/pngquant.tar.gz', import.meta.url));

await binBuild.file(source, [
'rm ./INSTALL',
`./configure --prefix="${bin.dest()}"`,
Expand All @@ -22,7 +21,6 @@ bin.run(['--version']).then(() => {

console.log('pngquant built successfully');
} catch (error) {
error.message = `pngquant failed to build, make sure that ${libpng} is installed`;
console.error(error.stack);

// eslint-disable-next-line unicorn/no-process-exit
Expand Down

0 comments on commit b80c567

Please sign in to comment.