From e3ce4614f0fe10bcb3b7466e714523da8af862eb Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Wed, 30 Mar 2011 19:46:04 +0800 Subject: [PATCH] Monitor.js --- Monitor.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Monitor.js b/Monitor.js index 26fc24bd..961785aa 100644 --- a/Monitor.js +++ b/Monitor.js @@ -65,17 +65,23 @@ Monitor.prototype = { }, /** * monitor a file or directory (privatish) + * + * initially called with ~/gitlive null 0 (effectvely) * * */ monitor : function(path, fn, depth) { var _this = this; + depth = depth ? depth *1 : 0; + + fn = fn || function (fm, f, of, event_type, uh) { _this.onEvent(fm, f, of, event_type, uh); } + // if we are not at top level.. and there is a .git directory (it's a submodule .. ignore) if (depth > 0 && GLib.file_test(path + '/.git' , GLib.FileTest.IS_DIR)) { return; } @@ -96,7 +102,7 @@ Monitor.prototype = { Gio.FileQueryInfoFlags.NONE, null); - //print("ADD path " + depth + ' ' + path); + print("ADD path " + depth + ' ' + path); while ((next_file = file_enum.next_file(null)) != null) { -- 2.39.2