Skip to content

Commit

Permalink
fix: Update packages/engine-twig-php/lib/engine_twig_php.js
Browse files Browse the repository at this point in the history
Co-Authored-By: Salem Ghoweri <me@salemghoweri.com>
  • Loading branch information
EvanLovely and sghoweri committed Apr 23, 2020
1 parent c8105f0 commit c67d50e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/engine-twig-php/lib/engine_twig_php.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,16 @@ const engine_twig_php = {
if (results.ok) {
resolve(results.html + details);
} else {
console.log(results.message);
process.exit(1);
// make Twig rendering errors more noticeable + exit when not in dev mode (or running the `patternlab serve` command)
if (
process.argv.slice(1).includes('serve') ||
process.env.NODE_ENV === 'development'
) {
reject(chalk.red(results.message));
} else {
console.log(chalk.red(results.message));
process.exit(1);
}
}
})
.catch(error => {
Expand Down

0 comments on commit c67d50e

Please sign in to comment.