watchr complains in console on older nodejs versions
billymoon opened this issue · comments
Temporary fix by fallback to fs.watch
in lib/helpers/livereload.coffee
...
# watchr = require 'watchr'
...
require('fs').watch path.resolve(app.program.args[0] or process.cwd()), (e, filename)->
m = filename.match /\.([^.]+)$/
extension = m?[1]
if !!extension and (app.handlers[extension] or app.mimes[extension])
served_filename = filename.replace RegExp("#{m[1]}$"), app.handlers[extension]?.chain or extension
request "http://127.0.0.1:#{app.program.port}/changed?files="+served_filename, (error, response, body)->
console.log 'livereloaded due to change: ' + filename
# watchr.watch
# path: path.resolve app.program.args[0] or process.cwd()
# catchupDelay: 200
# listeners:
# change: (type, filename)-> # additional arguments: currentStat and originalStat
# m = filename.match /\.([^.]+)$/
# extension = m?[1]
# if !!extension and (app.handlers[extension] or app.mimes[extension])
# served_filename = filename.replace RegExp("#{m[1]}$"), app.handlers[extension]?.chain or extension
# request "http://127.0.0.1:#{app.program.port}/changed?files="+served_filename, (error, response, body)->
# console.log 'livereloaded due to change: ' + filename