Created
October 18, 2013 14:45
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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