From 20b935878bbcb89443f27c4da925e07f96255386 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Fri, 11 Oct 2024 13:54:24 +0200 Subject: [PATCH] fix #75: detect `sass` binary in the path and use it if available (#76) --- src/SassBuilder.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/SassBuilder.php b/src/SassBuilder.php index 29f135e..d22c7d4 100644 --- a/src/SassBuilder.php +++ b/src/SassBuilder.php @@ -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; @@ -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); } /**