Lessc Textmate bundle doesn't save .css file

2

I installed: https://github.com/appden/less.tmbundle and the lessc compiler and it seems to work (no errors) but I don't see a compiled .css file.

Any ideas?

Chris

Posted 2013-01-07T18:02:27.200

Reputation: 133

Answers

1

To change the filename from less > css, just use a simple replacement:

system("lessc --verbose \"#{file}\" \"#{file.gsub(/less$/, 'css')}\"")

Leaving the verbose flag will result in a nice feedback message stating your file has been saved to xxx.css.

Frank Huffener

Posted 2013-01-07T18:02:27.200

Reputation: 26

1

I edited the bundle command to this:

#!/usr/bin/env ruby
file = STDIN.read[/lessc: ([^*]+\.less)/, 1] || ENV["TM_FILEPATH"]
system("lessc \"#{file}\" \"#{file}.css\"")

And now it works. But it saves a file (sample.less) to sample.less.css which is ok but not ideal.

Chris

Posted 2013-01-07T18:02:27.200

Reputation: 133