Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #82, while maintaining compatibility with #72. Uses fs.watch as a fallback. #85

Merged
merged 1 commit into from
Apr 23, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions nodemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@ var fs = require('fs'),
reEscapeChars = /[.|\-[\]()\\]/g,
reAsterisk = /\*/g;

// test to see if the version of find being run supports searching by seconds (-mtime -1s -print)
if (noWatch) {
exec('find -L /dev/null -type f -mtime -1s -print', function(error, stdout, stderr) {
if (error) {
if (!fs.watch) {
util.error('\x1B[1;31mThe version of node you are using combined with the version of find being used does not support watching files. Upgrade to a newer version of node, or install a version of find that supports search by seconds.\x1B[0m');
process.exit(1);
} else {
noWatch = false;
}
}
});
}

function startNode() {
util.log('\x1B[32m[nodemon] starting `' + program.options.exec + ' ' + program.args.join(' ') + '`\x1B[0m');

Expand Down