compass support & file watchers?
I can't get the compass file watcher to work, and I'm having trouble to understand the settings "compass support" & file watchers settings and their relationship.
First, from the command line I'm able to compile the project normally running either "compass compile" or "/usr/local/bin/compass compile". I'm running OSX Sierra, y and compass was installed doing 'sudo gem install compass'.
But on the "File watcher" settings it only works if I set the full path ("/usr/local/bin"). Which is not particularly great since the watcher configuration is shared among team-members (watcherTasks.xml), and other team-members may use a different path altogether to run compass, for whatever reasons. Why does PHPStorm fail to find "compass" unless I specify the full path? Doesn't it inherit the system's PATH access?
And as a bonus, what's the use of the "Enable Compass" support setting? On the docs it implies that setting this on somehow enable the use of the watchers, but that is not the case at all. I have disable "compass support", and file watchers work normally. And when I enable it, I don't see anything different on my project.
Feeling pretty dumb about this, but I just don't see what effect does it have and how is it required.
Please sign in to leave a comment.
Hi there,
>Why does PHPStorm fail to find "compass" unless I specify the full path? Doesn't it inherit the system's PATH access?
Extremely likely because it creates process directly where find-command-in-path resolving is not performed (as it's done by actual shell (e.g. bash).. and it's not get called here).
If you wish -- create custom shell script (e.g. "my-compass.sh" or whatever) and actually call compass inside it -- this way it will be executed using your shell.
>and other team-members may use a different path altogether to run compass,
See previous suggestion -- should help.
Another possible option -- use Path Variables functionality (https://www.jetbrains.com/help/phpstorm/path-variables.html). With that in place (NOTE: must be set up on all computers where it will be used) the path or portion of it that matches such path variable will be stored as $PathVariableName$ inside the config file while you (user) will still see it as actual path (it's all transparent to user). This way on one computer it may point to "/usr/local/bin" and on another it will be "/Users/John.Smith/Compass" (for example).
I don't understand why it doesn't work for compass, but the built-in support for npm or composer works fine, no need to specify absolute paths.
And that ties with my other question: what is it the "Enable Compass Support" for? Since I can use compass file watchers without enabling the setting, and I fail to see what difference does it make to have it enabled or disabled... what is it for?
>but the built-in support for npm or composer works fine, no need to specify absolute paths.
Where. Please be more specific.
In my setup (I'm on Windows though) I see full paths to npm/composer.
But the possible explanation could be that it gets executed differently (e.g. IDE may run "which composer" or alike and then use that full path internally/behind the scene .. as it assembles full command on the fly .. where File Watcher executes whatever specified directly (ignoring macro substitutions here))
>And that ties with my other question: what is it the "Enable Compass Support" for?
No idea -- not using Compass myself.
But it must be adding some functions/variable resolving functionality for IDE
https://www.jetbrains.com/help/phpstorm/compass.html
https://blog.jetbrains.com/webstorm/2013/12/using-compass-in-webstorm/