Skip to content

Commit

Permalink
fix #75: detect sass binary in the path and use it if available
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Oct 10, 2024
1 parent befe180 commit e566f59
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/SassBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
namespace Symfonycasts\SassBundle;

use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\Process\ExecutableFinder;
use Symfony\Component\Process\InputStream;
use Symfony\Component\Process\Process;

Expand Down Expand Up @@ -182,7 +183,9 @@ public function setOutput(SymfonyStyle $output): void

private function createBinary(): SassBinary
{
return new SassBinary($this->projectRootDir.'/var', $this->binaryPath, $this->output);
$binaryPath = (new ExecutableFinder())->find('sass') ?? $this->binaryPath;

return new SassBinary($this->projectRootDir.'/var', $binaryPath, $this->output);
}

/**
Expand Down

0 comments on commit e566f59

Please sign in to comment.