diff options
author | Garren Smith <garren.smith@gmail.com> | 2013-07-01 15:24:00 +0200 |
---|---|---|
committer | Garren Smith <garren.smith@gmail.com> | 2013-07-01 15:24:00 +0200 |
commit | 6e8f47c7f504abbfdef3ddfa63aa9a8826e94445 (patch) | |
tree | 470f544194816a8359b5b81bb7d4f202170bcca2 | |
parent | e204f0d0dbe9ae6385bcc225218731105fd5ff5e (diff) | |
download | couchdb-6e8f47c7f504abbfdef3ddfa63aa9a8826e94445.tar.gz |
Fauxton: Add dependancies to watch path instead of custom watch path
-rw-r--r-- | src/fauxton/Gruntfile.js | 2 | ||||
-rw-r--r-- | src/fauxton/settings.json.default | 4 | ||||
-rw-r--r-- | src/fauxton/tasks/helper.js | 14 |
3 files changed, 14 insertions, 6 deletions
diff --git a/src/fauxton/Gruntfile.js b/src/fauxton/Gruntfile.js index 35a2c6764..700246f44 100644 --- a/src/fauxton/Gruntfile.js +++ b/src/fauxton/Gruntfile.js @@ -206,7 +206,7 @@ module.exports = function(grunt) { }, watch: { - files: helper.readSettingsFile().watch.files, + files: helper.watchFiles(["./app/**/*"]), tasks: ['debug', 'template'] }, diff --git a/src/fauxton/settings.json.default b/src/fauxton/settings.json.default index 051e3fb1d..9716ceb3d 100644 --- a/src/fauxton/settings.json.default +++ b/src/fauxton/settings.json.default @@ -24,9 +24,5 @@ "okay_if_missing": true } } - }, - - "watch": { - "files": ["./app/**/*"] } } diff --git a/src/fauxton/tasks/helper.js b/src/fauxton/tasks/helper.js index 5178ee2e4..a7eddbf7a 100644 --- a/src/fauxton/tasks/helper.js +++ b/src/fauxton/tasks/helper.js @@ -10,9 +10,11 @@ // License for the specific language governing permissions and limitations under // the License. -var fs = require('fs'); +var fs = require('fs'), + path = require('path'); exports.init = function(grunt) { + var _ = grunt.util._; return { readSettingsFile: function () { @@ -27,6 +29,16 @@ exports.init = function(grunt) { processAddons: function (callback) { this.readSettingsFile().deps.forEach(callback); + }, + + watchFiles: function (defaults) { + return _.reduce(this.readSettingsFile().deps, function (files, dep) { + if (dep.path) { + files.push(path.join(dep.path, '**/*')); + } + return files + }, defaults); + } }; }; |