Created
August 9, 2013 12:43
-
-
Save bmihelac/6193333 to your computer and use it in GitHub Desktop.
Alias to watch and recompile less files on change, printing errors. Requires watchr.
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
alias watchless='watchr -e '\''require "date"; watch("(.*)\.less$") { |f| cmd = "lessc #{f[0]} --source-map #{f[1]}.css"; puts "#{DateTime.now}: #{cmd}"; output = `#{cmd}`; if $? != 0 then puts output end }'\''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sample output: