Relative paths in External Tools Parameters

I have set up SASS processing as per this post. It works fine provided that the css files reside alongside the scss files (or in a directory below), but I want to divide my files into css and scss folders.

+ html

   + scss
     - main.scss

   + css
     - main.css


I cannot figure out how to do this using a macro:

This works:
--watch "$FilePath$":"$FileDir$\css\$FileNameWithoutExtension$.css"

but this does not (with a relative path like you can in Visual Studio):

--watch "$FilePath$":"$FileDir$\..\css\$FileNameWithoutExtension$.css"

I looked at some of the other macros, but nothing will get me to the parent directory.

Any help would be appreciated.

Ken



      

2 comments
Comment actions Permalink

On a related note, how do I get all files in the CSS folder to be treated as plain text? Right now I have to mark each one as plain text. I want them to be treated as plain text because otherwise all class references are shown twice for navigation.

I know I can exclude the folder completely, but then I get warnings in my HTML that the paths don't exist.

Thanks,
Ken

0
Comment actions Permalink

Hi Ken,

All available macros are already listed in Edit External Tool window (when clicking on "Insert macro..." button). All macros (except maybe prompt) are just a variables and not functions that can take parameters and there is no macro for parent-folder-of-parent-folder-of-current-file (that's what you need here, right?)

(with a relative path like you can in Visual Studio)

Will it work if you put such path directly in console? If not -- then it's a scss compiler/watcher issue and such path should fail in VS as well (if passed in similar manner).

Try this idea: instead of excuting such command directly (or via External Tools at all) -- why not try:

  • Phing custom task -- it can take parameters and your custom php code can pre-process it as required (to get rid of "..\" -- to use proper path with no relative parts)
  • Write custom php script that will be called instead -- it will pre-process file names and then will launch the watcher.

I've not tried this myself, so cannot say how good these ideas are (in particluar, will watcher still be running after task is over).

Other than that -- think about different directory structure, so you can use hardcoded paths relative to the project root (macro for Project Root is available).

On a related note, how do I get all files in the CSS folder to be treated as plain text? Right now I have to mark each one as plain text. I want them to be treated as plain text because otherwise all class references are shown twice for navigation.

You can only mark files as plain text one-by-one or.. assign *.css pattern to Text files instead of CSS in "Settings | File Types" -- but this will affect whole IDE/all projects.

0

Please sign in to leave a comment.