Skip to content

Commit

Permalink
Updated ignore paths
Browse files Browse the repository at this point in the history
  • Loading branch information
petruisfan committed Sep 18, 2015
1 parent a7db88f commit 46d56a1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ clean up all the inter-module references, and without a whole new
If "error", an exit code of 0 will still restart.
If "exit", no restart regardless of exit code.

-t|--non-interactive
Dissable interactive capacity
With this option, supervisor won't listen to stdin

--force-watch
Use fs.watch instead of fs.watchFile.
This may be useful if you see a high cpu load on a windows machine.
Expand All @@ -69,10 +73,10 @@ clean up all the inter-module references, and without a whole new

-q|--quiet
Suppress DEBUG messages


Options available after start:
rs - restart process. Useful when you want to restart your program even
rs - restart process. Useful when you want to restart your program even
if no file has changed.


Expand All @@ -84,6 +88,8 @@ clean up all the inter-module references, and without a whole new
supervisor -- server.js -h host -p port


In order to not watch for file changes, use "-i .".

## Simple Install

Just run:
Expand Down
17 changes: 10 additions & 7 deletions lib/supervisor.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,17 @@ function run (args) {

var watchItems = watch.split(',');
watchItems.forEach(function (watchItem) {
watchItem = path.resolve(watchItem);
log("Watching directory '" + watchItem + "' for changes.");
if(interactive) {
log("Press rs for restarting the process.");
watchItem = path.resolve(watchItem);

if ( ! ignoredPaths[watchItem] ) {
log("Watching directory '" + watchItem + "' for changes.");
if(interactive) {
log("Press rs for restarting the process.");
}
findAllWatchFiles(watchItem, function(f) {
watchGivenFile( f, poll_interval );
});
}
findAllWatchFiles(watchItem, function(f) {
watchGivenFile( f, poll_interval );
});
});
};

Expand Down
6 changes: 3 additions & 3 deletions test/sampleApp/server.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#!/usr/bin/env node

var express = require('express');
var app = express();

app.get('/', function (req, res) {
//
// CORS
//
res.setHeader("Access-Control-Allow-Origin", "http://cors-client.com");
res.send('Hello World!')
res.setHeader("Access-Control-Allow-Origin", "*");
res.send('Hello World!');
});

var server = app.listen(3000, function () {
var host = server.address().address;
var port = server.address().port;

console.log('Example app listening at http://%s:%s', host, port);
});

0 comments on commit 46d56a1

Please sign in to comment.