How to use Path Variable as working dir for external tool
I've set up Autoprefixer as an external tool. However, the working dir is going to be different on different projects.
So I created a path variable: PATH_TO_DIST_STYLES
(and I used the GUI directory picker to pick the directory - so I know the directory exists, isn't typo-ed)
Then in autoprefixer (which I've added as an External Tool), I set it's Working directory to $PATH_TO_DIST_STYLES$
But when I try to run autoprefixer I get the error:
"Cannot start process, the working directory $PATH_TO_DIST_STYLES$ does not exist."
What am I doing wrong?
Thanks!
Abby
Please sign in to leave a comment.
Hi there,
>What am I doing wrong?
A lot.
1) Path variable is an IDE-wide setting and not per-project.
With "However, the working dir is going to be different on different projects." in mind using Path Variables does not make much (any?) sense (unless I'm missing something fundamental here)
2) "I set it's Working directory to $PATH_TO_DIST_STYLES$" -- it's a wrong usage. It simply does not work like that.
Thing is -- user created path variables work completely transparent for the user and you will not see them anywhere in a GUI (except the place where you manage them) -- they only will be used in config files.
Example:
https://www.jetbrains.com/help/phpstorm/2016.2/path-variables.html?search=path%20var
-----
>I've set up Autoprefixer as an external tool.
Maybe try it as File Watcher instead (will be run on File Save on modified files) --- just a suggestion as I do not know how exactly you are planning to use it. But i's a good one (considering the nature of Autoprefixer ) as it's a per-project setting so no conflicts between the projects (and therefore each project can be setup differently).
Another suggestion -- considering what Autoprefixer is -- it makes perfect sense to have it as a task in your Gulp/Grunt/whatever.