Home Download Buy Blog Forum Support

Build System preserving folder structure

Build System preserving folder structure

Postby socrattes on Fri May 04, 2012 8:50 pm

Hey!

I'm trying to create a sublime-build code in order to work on this folder structure

Code: Select all
root
|-- app
|   |--css
|   |--js
|
|-- app-raw
|  |--less
|  |      |-- style.less
|  |
|  |--coffeescript
|          |-- app.coffee



I'm trying to complie a less file and put it into the css folder wiht the same name. I've tried this:

Code: Select all
"lessc > $project_path/app/css/$file_base_name.css --yui -compress"


And it work great, but If I want to add subfolders like this

Code: Select all
root
|-- app
|   |--css
|   |--js
|
|-- app-raw
|  |--less
|  |     |-- style2.less
|  |     |--somefolderName
|  |           |-- style2.less
|  |
|  |--coffeescript
|          |-- app.coffee


Then I don't know how to make the system, dynamically understand which folder it has to put the compiled file.
Is there anyway to know, on the sublime-build file, which is the folder above (or ideally some folder until a certain one)

Also, is there any way for the selector to work only on certain files based on the name?


Thanks in advance!
socrattes
 
Posts: 13
Joined: Fri Mar 30, 2012 9:25 pm

Re: Build System preserving folder structure

Postby socrattes on Sat May 05, 2012 6:46 pm

I've found a solution to my problem. I'm using this regex with my project.
Code: Select all
{
   "cmd": ["cmd", "/c", "coffee --watch --compile --bare --output ./${file_path/-raw//}", "$file"],
   "selector": "source.coffee"
}


It simply looks for the file path, if it contains "-raw" it gets delited. Works great :)
socrattes
 
Posts: 13
Joined: Fri Mar 30, 2012 9:25 pm


Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot] and 11 guests