Browse Source

Merge remote-tracking branch 'origin/chokidar'

master
Brett Langdon 12 years ago
parent
commit
7608166111
2 changed files with 12 additions and 7 deletions
  1. +10
    -5
      lib/index.js
  2. +2
    -2
      package.json

+ 10
- 5
lib/index.js View File

@ -3,7 +3,7 @@ var parse = require('shell-quote').parse;
var path = require('path');
var rc = require('rc');
var spawn = require('child_process').spawn;
var watch = require('watch');
var chokidar = require('chokidar');
module.exports.tend = function(dir, rawCommand, options) {
options = options || {};
@ -46,16 +46,20 @@ module.exports.tend = function(dir, rawCommand, options) {
console.log(('Process ' + pid + ' Started').green);
}.bind(this);
if(options.start){
if (options.start) {
startCommand();
}
if(options.runOnce){
if (options.runOnce) {
return;
}
watch.watchTree(dir, function(f, curr, prev) {
if (curr === null && prev === null) {
var ignoreEvents = ['add', 'addDir'];
chokidar.watch(dir, {
persistent: true
})
.on('all', function(e, f) {
if (~ignoreEvents.indexOf(e)) {
return;
}
if (ignoreHidden) {
@ -64,6 +68,7 @@ module.exports.tend = function(dir, rawCommand, options) {
return;
}
}
if (!filter.test(f)) {
return;
}


+ 2
- 2
package.json View File

@ -26,11 +26,11 @@
},
"homepage": "https://github.com/brettlangdon/tend",
"dependencies": {
"watch": "~0.10.0",
"docopt": "~0.4.0",
"colors": "~0.6.2",
"shell-quote": "~1.4.1",
"rc": "~0.4.0"
"rc": "~0.4.0",
"chokidar": "~0.8.2"
},
"bin": {
"tend": "bin/tend"


Loading…
Cancel
Save