Skip to content

Instantly share code, notes, and snippets.

@Ceda
Created October 18, 2013 14:55
Show Gist options
  • Save Ceda/7042792 to your computer and use it in GitHub Desktop.
Save Ceda/7042792 to your computer and use it in GitHub Desktop.
TMBundle LESS - compile only if filename is style.less
#!/usr/bin/env ruby
filename = File.basename(ENV["TM_FILEPATH"])
if (filename=="style.less")
file = STDIN.read[/lessc: ([^*])+\.less/, 1] || ENV["TM_FILEPATH"].chomp(File.extname(ENV["TM_FILEPATH"]))
system("lessc -x \"#{file}.less\" > \"#{file}.css\"")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment