couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [21/50] [abbrv] git commit: Handle cleaning up addons better
Date Mon, 11 Feb 2013 11:12:15 GMT
Handle cleaning up addons better

Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/fd219f5f
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/fd219f5f
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/fd219f5f

Branch: refs/heads/fauxton
Commit: fd219f5f247e33ee1f5f8d3a41b8bd3b4d59f516
Parents: 217dce0
Author: Simon Metson <simon+github@cloudant.com>
Authored: Sun Jan 27 11:02:11 2013 +0100
Committer: Simon Metson <simon+github@cloudant.com>
Committed: Sun Jan 27 13:07:26 2013 +0100

----------------------------------------------------------------------
 src/fauxton/grunt.js |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/fd219f5f/src/fauxton/grunt.js
----------------------------------------------------------------------
diff --git a/src/fauxton/grunt.js b/src/fauxton/grunt.js
index 18ba7e1..19a6d96 100644
--- a/src/fauxton/grunt.js
+++ b/src/fauxton/grunt.js
@@ -13,11 +13,29 @@ module.exports = function(grunt) {
             }
   };
 
+  var cleanable = function(){
+    var path = require('path');
+    // You'll always want to clean these two directories
+    var theListToClean = ["dist/", "app/load_addons.js"];
+
+    // Now find the addons you have and add them for cleaning up
+    if (path.existsSync("settings.json")){
+      var settings = grunt.file.readJSON("settings.json") || {deps: []};
+      settings.deps.forEach(function(addon){
+        // Don't clean up the default addons
+        if (['config', 'logs', 'stats'].indexOf(addon.name) == -1){
+          theListToClean.push("app/addons/" + addon.name);
+        }
+      });
+    }
+    return theListToClean;
+  }();
+
   grunt.initConfig({
 
     // The clean task ensures all files are removed from the dist/ directory so
     // that no files linger from previous builds.
-    clean: ["dist/", "app/load_addons.js", "app/addons/search", "app/addons/dashboard"],
+    clean:  cleanable,
 
     // The lint task will run the build configuration and the application
     // JavaScript through JSHint and report any errors.  You can change the


Mime
View raw message