Skip to content

Commit

Permalink
Fixed Less file compiling
Browse files Browse the repository at this point in the history
  • Loading branch information
buger committed Mar 12, 2012
1 parent 302e83b commit 8eb83ec
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Cakefile
Expand Up @@ -115,7 +115,8 @@ compile = (file, ext) ->
when 'coffee'
exec "coffee -c #{file}"
when 'less'
exec 'lessc #{file}'
css = file.replace(".less", ".css")
exec "lessc #{file} > #{css}"


task "compile", "Compile all files", (options) ->
Expand All @@ -142,9 +143,12 @@ task 'watch', 'watch and compile coffee, less and tmpl files', ->
walk __dirname, (err, files) ->
for file in files
((file) ->
if ext = file.match(/\.(tmpl|coffee|less)$/)?[1]
fs.watch file, (event) -> compile file, ext

if ext = file.match(/\.(tmpl|coffee|less)$/)?[1]
compileFunc = _.throttle ->
compile file, ext
, 100

fs.watch file, compileFunc
)(file)


Expand Down

0 comments on commit 8eb83ec

Please sign in to comment.