appden / less.tmbundle

LESS TextMate Bundle
http://lesscss.org/
295 stars 49 forks source link

I cannot get compiling to work #2

Open valentinvieriu opened 13 years ago

valentinvieriu commented 13 years ago

I don't see how it can even work. Pressing command + B just pops out a make build

Thank you

RogWilco commented 13 years ago

I'm running into some issues as well, though at least for me, [Command] + [B] was the default shortcut. At first it couldn't find the lessc binary, but once I fixed that I get this response from TextMate:

"env: node: No such file or directory"

I get the feeling there's an issue with how it is determining the path to the current file being saved. Any ideas?

qpleple commented 12 years ago

@valentinvieriu try ⌘ + S

@RogWilco You get this message when lessc is failing because Node.js does not find the less module. You get more info by trying to run:

lessc --verbose /path/to/file.less

On OS X, you can fix this by installing the Node Package Manager, npm, (with port: sudo port install npm) and then sudo npm install less -g.

cmyk commented 12 years ago

Doesn't work at all for me. I have the lessc in my PATH: bash-3.2# lessc -h usage: lessc source [destination] When I press save (⌘ + S) it's just showing a tooltip. And no .css with the same name is saved.

tmtrademark commented 12 years ago

I have the same issue as cmyk.

I was able to get all the errors to go away but now when I ⌘ + S it just shows in a tooltip.

rduenasf commented 12 years ago

Try changing the Save to CSS command to:

#!/usr/bin/env ruby
file = STDIN.read[/lessc: ([^*])+\.less/, 1] || ENV["TM_FILEPATH"].chomp(File.extname(ENV["TM_FILEPATH"]))
system("lessc --verbose \"#{file}.less\" \"#{file}.css\"")
cmyk commented 12 years ago

Seems to do the trick! Thanks!

ColinWaddell commented 12 years ago

Stumbled across this thread whilst having the same "env: node: No such file or directory" problem.

I couldn't get any of the given answers on this thread to alleviate the issue.

Ended up just rewriting the Save to CSS command as simply one-line

lessc --verbose $TM_FILEPATH ${TM_FILEPATH%.less}.css

This seems to work ok, if it is of any use to anyone.

nicholaspufal commented 12 years ago

In order to get this to work I had to add /usr/local/bin to my TextMate PATH.

guitdev commented 8 years ago

Thanks @ColinWaddell

madranet commented 6 years ago

I've just run into this myself. I think it may be down to the fact I recently uninstalled node. It was working fine before.

I ended up here after banging my head against a wall wondering why some new CSS rules I was writing were not 'doing anything' on a web page I was building.

What I found irritating is that the bundle reports success [via the yellow tooltip pane that briefly pops up], even when the CSS hasn't actually compiled. It was only because I happened to look at the last modification date on my CSS file and see that it was months ago, that I noticed it wasn't actually being compiled at all. In spite of that, the Less bundle kept telling me Compiled CSS to /path/to/file.css each time I ran the compile command.

Looking at the code for the command, it's obvious it doesn't error check in any way. It just calls system("lessc ... ") and then prints out "Compiled CSS to ... " whether or not the lessc command succeeded or failed. Is it not possible to 'read back' the result of the lessc command and puts that instead. That would get rid of false positives.