berfarah / LESS-build-sublime

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

Directory Rewrite not working #24

Closed bbbenji closed 12 years ago

bbbenji commented 12 years ago

I have run "changeLESSBuildType.bat" as Administrator and selected option 2.

1. Print Normal
2. Print Directory Rewrite
Type the number to print text.2
symbolic link created for LESS.sublime-build <<===>> LESS-rewriteDir.sublime-bui
ld-choice
Press any key to continue . . .

But it still saves .css in the same directory as my .less.

My directory structure:

Client -library --css ---style.css --less ---style.less

Am I missing something?

jess-sol commented 12 years ago

No, that should work; what OS are you using?

bbbenji commented 12 years ago

Windows 7

jess-sol commented 12 years ago

What are the absolute file paths of where you are saving and where it should be saving?

bbbenji commented 12 years ago

X:\SpiderOak\work\Zorro\redesign\zorro\library\less\style.less

X:\SpiderOak\work\Zorro\redesign\zorro\library\css\style.css

jess-sol commented 12 years ago

Open your Packages dir (Preferences -> Browse Packages), open the LESS-build directory, and open LESS-rewriteDir.sublime-build-choice

Inside that file, on line 13, replace ${file_path/(.*)less(.*)/\\1css\\2/}\\\\${file_base_name}.css with ${file_path/\/\\(.*)less(.*)\\\//\\1css\\2\\\\/}\\\\${file_base_name}.css

Build that and give me the output your console give you

bbbenji commented 12 years ago

[Compile] X:\SpiderOak\work\Zorro\redesign\zorro\library\less\style.less -> X:\SpiderOak\work\Zorro\redesign\zorro\library\less\style.css [Done] [Finished in 0.6s]

jess-sol commented 12 years ago

Alright, replace all of line 13 with: "cmd": ["echo", "${file_path/(.*)less(.*)/\\1css\\2\\\\/}\\${file_base_name}.css"]

It should give you an Error Code 2, again copy and paste that into here please.

bbbenji commented 12 years ago

Something is not right, perhaps with the symlink? It completes the build and spits out no error. I even re-ran "changeLESSBuildType.bat" as Administrator and selected option 2 again.

jess-sol commented 12 years ago

Alright, open up cmd cd to the package directory (inside LESS-build). Should be something like: cd "C:\Users\Max\AppData\Roaming\Sublime Text 2\Packages\LESS-build"

Then type: del LESS.sublime-build mklink LESS.sublime-build LESS-rewriteDir.sublime-build-choice

Then test it again, if you don't get the error code; then type del LESS.sublime-build cp LESS-rewriteDir.sublime-build-choice LESS.sublime-build

If again nothing changes, try restarting sublime. Tell me how that goes

bbbenji commented 12 years ago

After following the first few steps: http://i.imgur.com/NeoWp.png

After following the second section of steps

[Error 2] The system cannot find the file specified
[cmd:  [u'echo', u'X:\\SpiderOak\\work\\CliftonDouglas.com\\redesign\\cliftondouglas\\library\\css\\${file_base_name}.css']]
[dir:  X:\SpiderOak\work\CliftonDouglas.com\redesign\cliftondouglas\library\less]
[path: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\]
[Finished]
jess-sol commented 12 years ago

After which step did this occur? After you made the symbolic link? Try the second section, deleting the symbolic link file, and copying the LESS-rewriteDir.sublime-build-choice file to LESS.sublime-build

bbbenji commented 12 years ago

Please see edited comment.

jess-sol commented 12 years ago

Alright, it seems to be an issue with the symlink, which is odd. I can only give you a quick fix, which is to use the copied file, but if there is an update to this plugin; yours will not be updated.

If you can figure out why your computer isn't handling the symlink correctly, you may be able to fix it.

In the mean time, replace the 13th line of the LESS.sublime-build file with "cmd": ["$packages\\LESS-build\\dotless.Compiler.exe", "$file", "${file_path/\/\\(.*)less(.*)\\\//\\1css\\2\\\\/}\\\\${file_base_name}.css"], as well as the 13th line of LESS-rewriteDir.sublime-build-choice.

bbbenji commented 12 years ago

Unfortunately it does not seem to work

[Compile]
X:\SpiderOak\work\Zorro\redesign\zorro\library\less\style.less -> X:\SpiderOak\work\Zorro\redesign\zorro\library\less\style.css
[Done]
[Finished in 0.6s]

I have edited both LESS.sublime-build and LESS-rewriteDir.sublime-build-choice and even restarted ST2.

jess-sol commented 12 years ago

Oops, sorry replace line 13 with "cmd": ["$packages\\LESS-build\\dotless.Compiler.exe", "$file", "${file_path/(.*)less(.*)/\\1css\\2/}\\\\${file_base_name}.css"] in both files

bbbenji commented 12 years ago

Amazing! Thank you for your help mazzzzz. Just need to figure out my symlink problem now.

jess-sol commented 12 years ago

Glad we got that fixed :), enjoy the plugin