berfarah / LESS-build-sublime

Less build sytem for Sublime Text 2
Apache License 2.0
91 stars 14 forks source link

Maintain folder structure #11

Closed jima-zillow closed 12 years ago

jima-zillow commented 12 years ago

I'm looking for a way to maintain my folder structure. Currently all my LESS files live in a 'less' directory. Within that directory some of the files are located in the root (less/master.less), and others are located within sub-folders (less/module/nav.less). I want my compiled files to have the same sub-folder hierarchy, but change the root folder from 'less' to 'css'.

What would a command for this look like? Write now I've got this:

"cmd": ["lessc", "$file", "${file_path}/../css/${file_base_name}.css", "--verbose"]

But this only works when the .less file is a direct child of my root directory.

didacrios commented 12 years ago

Hi, i have the same "issue" on windows, let me show my config for MIN.LESS.sublime-build as i fixed, the problem

that works perfect on win

{
"cmd": ["lessc", "$file", "${file_path}/${file_base_name}.css", "-x", "--verbose"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.css.less",

"osx":
{
    "path": "/usr/local/bin:$PATH"
},

"windows":
{
    "cmd": ["dotless.Compiler.exe", "-m", "$file", "..\\css\\\\${file_base_name}"],
    "path": "%APPDATA%\\Sublime Text 2\\Packages\\LESS-build" //Not sure why "${packages}\\LESS-build" doesn't work
}

}

jess-sol commented 12 years ago

This is the solution I came up with, works well.

Replace the windows cmd line with: "cmd": ["dotless.Compiler.exe", "$file", "${file_path/\less\/\css\/g}\${file_base_name}.css"],

didacrios commented 12 years ago

@mazzzzz solution makes my dotless.Compiler.exe crash!

and the console returns:

Unhandled Exception: System.ArgumentException: The path is not of a legal form.
    at System.IO.Path.NormalizePathFast(String path, Boolean fullCheck)
    at System.IO.Path.NormalizePath(String path, Boolean fullCheck)
    at System.IO.Path.GetDirectoryName(String path)
    at dotless.Compiler.Program.Main(String[] args)
jess-sol commented 12 years ago

Sorry, I copied an old version of the command, the new version is commented out in the .sublime-build file, you can use that one, and it works perfectly

jess-sol commented 12 years ago

Hi, just a heads up, in the newest version, if you go to the package directory (look at the readme for your os's package directory path) and run the script changeLESSBuildType.bat (or changeLESSBuildType.sh for osx/linux) and select option 2. This will configure the builder to put the css in the css directory (more info and an example in the readme).

mlms13 commented 12 years ago

Sorry to dig up an old issue, but I just wanted to say that you are awesome and this makes my day. :)