feat: Option to search sass executable#94
feat: Option to search sass executable#94qdequippe wants to merge 1 commit intoSymfonyCasts:mainfrom
Conversation
bocharsky-bw
left a comment
There was a problem hiding this comment.
Hm, I think we don't need that extra arguemnt, how about simplify the business logic in that method?
| $binaryPath = $this->binaryPath; | ||
|
|
||
| if (null === $binaryPath && $this->searchBinary) { | ||
| $binaryPath = (new ExecutableFinder())->find('sass'); | ||
| } |
There was a problem hiding this comment.
Are you sure we need this searchBinary extra parameter? Why we can't just tweak this logic to:
| $binaryPath = $this->binaryPath; | |
| if (null === $binaryPath && $this->searchBinary) { | |
| $binaryPath = (new ExecutableFinder())->find('sass'); | |
| } | |
| $binaryPath = $this->binaryPath; | |
| if (null === $binaryPath) { | |
| $binaryPath = (new ExecutableFinder())->find('sass'); | |
| } |
There was a problem hiding this comment.
Yes I need it because in my case $this->binaryPath is null so $binaryPath will be null and an executable will be found.
I want to force $binaryPath to be null here, thanks to that SassBinary will download the binary locally.
There was a problem hiding this comment.
Hm, that's what I'm talking about... if you have binaryPath set to null, then this code should be enough for you to find the binary:
$binaryPath = $this->binaryPath;
if (null === $binaryPath) {
$binaryPath = (new ExecutableFinder())->find('sass');
}Or you don't want the bundle to use your global sass locally and always download the new one?
There was a problem hiding this comment.
Or you don't want the bundle to use your global sass locally and always download the new one?
yes that's it! :)
|
Hey @qdequippe , sorry for the long reply! OK, once again, what are we trying to solve here that can't be achieved with the changes we have in master so far? As I understand, right now, if the path isn't specified explicitly in the config, we will try to find the path for executable You suggest a config option that will help to decide if we should search the executable path or not. It would help to force downloading the latest version even if Sass is installed in the system globally, right? But if you have a Sass bin globally installed in your system, why would you want to not use it then? I mean, you can update it yourself globally to the latest. Or if you don't use that global I mean, we're trying to add more config options here that might be just redundant and confusing. Why don't you want to solve this a different way, which is more appropriate IMO. Could you explain your point of view, please? |
|
hi @bocharsky-bw my use case is that on my hosting provider there is a version of the sass binary that does not supports I would like to have an option to say to the bundle "ok download the binary everytime" :) I hope I've been clear, feel free to ask if not |
I recently encountered this issue (see #84) during a deployment to a cloud environment. Since this specific environment restricts the installation of external binaries, I suggest adding a configuration option that allows the bundle to automatically download the appropriate binary during cloud build phase.