You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ch...@apache.org on 2013/03/15 22:50:08 UTC

[19/50] git commit: allow addons to have images

allow addons to have images


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

Branch: refs/heads/fauxton-rebase
Commit: 152786d5b5b9c5b045574faae4f146a071c74595
Parents: 2693bb9
Author: Simon Metson <si...@cloudant.com>
Authored: Fri Feb 15 15:17:48 2013 +0000
Committer: Russell Branca <ch...@gmail.com>
Committed: Fri Mar 15 14:35:40 2013 -0700

----------------------------------------------------------------------
 src/fauxton/grunt.js |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/152786d5/src/fauxton/grunt.js
----------------------------------------------------------------------
diff --git a/src/fauxton/grunt.js b/src/fauxton/grunt.js
index 37d3a7b..33ec8ad 100644
--- a/src/fauxton/grunt.js
+++ b/src/fauxton/grunt.js
@@ -13,7 +13,7 @@ module.exports = function(grunt) {
               }
             }
   };
-  
+
   function processAddons(callback){
     if (path.existsSync("settings.json")){
       var settings = grunt.file.readJSON("settings.json") || {deps: []};
@@ -40,14 +40,15 @@ module.exports = function(grunt) {
     // Base assets
     var theAssets = {
       less:{
-        paths: ["assets/less"], 
+        paths: ["assets/less"],
         files: {
           "dist/debug/css/fauxton.css": "assets/less/fauxton.less"
         }
-      }
+      },
+      img: ["assets/img/**"]
     };
-    // Less files from addons
     processAddons(function(addon){
+      // Less files from addons
       var root = addon.path || "app/addons/" + addon.name;
       var lessPath = root + "/assets/less";
       if(path.existsSync(lessPath)){
@@ -56,11 +57,17 @@ module.exports = function(grunt) {
         theAssets.less.files["dist/debug/css/" + addon.name + ".css"] =
             lessPath + "/" + addon.name + ".less";
       }
+      // Images
+      var root = addon.path || "app/addons/" + addon.name;
+      var imgPath = root + "/assets/img";
+      if(path.existsSync(imgPath)){
+        theAssets.img.push(imgPath + "/**");
+      }
     });
-
+    grunt.log.write(theAssets.img[0]);
     return theAssets;
   }();
-  
+
   grunt.initConfig({
 
     // The clean task ensures all files are removed from the dist/ directory so
@@ -309,14 +316,14 @@ module.exports = function(grunt) {
         files:{
           "dist/release/js/": "assets/js/**",
           //"dist/release/css/**": "assets/css/**"
-          "dist/release/img/": "assets/img/**"
+          "dist/release/img/": assets.img
         }
       },
       debug:{
         files:{
           "dist/debug/js/": "assets/js/**",
           //"dist/debug/css/": "dist/release/css/**"
-          "dist/debug/img/": "assets/img/**"
+          "dist/debug/img/": assets.img
         }
       }
     },