Skip to content

Commit

Permalink
fix #75: detect sass binary in the path and use it if available (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol authored Oct 11, 2024
1 parent befe180 commit 20b9358
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 = $this->binaryPath ?? (new ExecutableFinder())->find('sass');

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

/**
Expand Down

0 comments on commit 20b9358

Please sign in to comment.