Skip to content

Commit

Permalink
Refs #1863 - show sass error messages in failed builds
Browse files Browse the repository at this point in the history
  • Loading branch information
mrook committed Nov 18, 2024
1 parent 1c51e6e commit 7cee2b3
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions src/Phing/Task/Ext/Sass/SassCompiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,11 @@ public function __construct(string $executable, string $flags)
*/
public function compile(string $inputFilePath, string $outputFilePath, bool $failOnError): void
{
try {
$output = $this->executeCommand($inputFilePath, $outputFilePath);
if ($failOnError && $output[0] !== 0) {
throw new BuildException(
"Result returned as not 0. Result: {$output[0]}",
Project::MSG_INFO
);
}
} catch (Exception $e) {
if ($failOnError) {
throw new BuildException($e);
}
list($return, $output) = $this->executeCommand($inputFilePath, $outputFilePath);
if ($failOnError && $return !== 0) {
throw new BuildException(
"Sass exited with return code {$return} and message '{$output[0]}'"
);
}
}

Expand Down

0 comments on commit 7cee2b3

Please sign in to comment.