Skip to content

Instantly share code, notes, and snippets.

@Ceda
Created October 18, 2013 14:45
Show Gist options
  • Select an option

  • Save Ceda/7042619 to your computer and use it in GitHub Desktop.

Select an option

Save Ceda/7042619 to your computer and use it in GitHub Desktop.
Texmate Less TMBundle - Compile to less if in css dir not in subdir
#!/usr/bin/env ruby
dir, base = File.split(File.dirname(ENV["TM_FILEPATH"]))
if (base=="css")
file = STDIN.read[/lessc: ([^*])+\.less/, 1] || ENV["TM_FILEPATH"].chomp(File.extname(ENV["TM_FILEPATH"]))
system("lessc \"#{file}.less\" > \"#{file}.css\"")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment