Sublime Forum

Build get path of file relative to project path

#1

Hi,

I’m trying to issue a build command like this:

{ "name": "Compile template using PHP", "cmd": "cmd", "/c", "C:\\PHP\\php.exe", "-f", "$file", ">", "$targetpath"], "file_regex": "*", "working_dir": "${file_path}" }
( $targetpath needs to be replaced )

Let’s say my projectdir is

C:\Users\Me\Project’\

I want to compile source file

C:\Users\Me\Project’*subdir1\subdir2\MyTemplate.html*

And have the output written to a build directory:
C:\Users\Me\Project’*BUILD\subdir1\subdir2\MyTemplate.html*

How can I get sublime to give me “subdir1\subdir2\MyTemplate.html” part of the source file? (so I can use that as $targetpath)

2nd question, can sublime issue the build command for all files in my project directory?

0 Likes