Skip to content
Browse files

Fix for #82, while maintaining compatibility with #72. Uses fs.watch …

…as a fallback.
  • Loading branch information...
1 parent 15a9803 commit e43df19b7ff6a2de8adb02fcb70e0d43dfa692ca @dylanmcd dylanmcd committed
Showing with 14 additions and 0 deletions.
  1. +14 −0 nodemon.js
View
14 nodemon.js
@@ -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');

0 comments on commit e43df19

Please sign in to comment.
Something went wrong with that request. Please try again.