Skip to content

Commit

Permalink
Move from gaze to chokidar (for node 0.11 and io.js support)
Browse files Browse the repository at this point in the history
  • Loading branch information
aurri committed Jan 23, 2015
1 parent 276532b commit bf4c255
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 27 deletions.
18 changes: 6 additions & 12 deletions compiler/index.js
Expand Up @@ -47,7 +47,7 @@ function help() {

var ph = require('path'),
sh = require('shelljs'),
gaze = require('gaze'),
chokidar = require('chokidar'),
compile = require('./compile')


Expand Down Expand Up @@ -127,17 +127,11 @@ var self = module.exports = {

self.make(opt)

var glob = toRelative(opt.flow[0] == 'f' ? opt.from : ph.join(opt.from, '**/*.tag'))

gaze(glob, function() {

log('Watching ' + glob)

this.on('all', function() {
self.make(opt)
})

})
var glob = opt.flow[0] == 'f' ? opt.from : ph.join(opt.from, '**/*.tag')

chokidar.watch(glob, { ignoreInitial: true })
.on('ready', function() { log('Watching ' + toRelative(glob)) })
.on('all', function(e, path) { self.make(opt) })

}

Expand Down
20 changes: 6 additions & 14 deletions make/dev.js
Expand Up @@ -4,23 +4,15 @@

require('shelljs/global')

var gaze = require('gaze'),
compile = require('../compiler/compile')
var chokidar = require('chokidar'),
riot = require('../compiler')


// watch and build riot.js
gaze('lib/*.js', function() {
this.on('changed', function() {
exec('make riot')
})
})
chokidar
.watch('lib/*.js', { ignoreInitial: true })
.on('all', function() { exec('make riot') })


// watch and build tags.js for testing
var tags = 'test/tag/*.tag'

gaze(tags, function() {
this.on('changed', function() {
compile(cat(tags)).to('dist/tags.js')
})
})
riot.watch({ from: 'test', to: 'dist/tags.js' })
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -32,7 +32,7 @@
"riot.js"
],
"dependencies": {
"gaze": "~0.6.4",
"chokidar": "~1.0.0-rc2",
"minimist": "~1.1.0",
"shelljs": "~0.3.0"
},
Expand Down

0 comments on commit bf4c255

Please sign in to comment.