Permalink
Browse files

Merge pull request #92 from zillow/omit-assets

Omit assets in non-skinnable builds when mod.assets === false
  • Loading branch information...
2 parents d0e0117 + 420aa91 commit e2233b0f99f903798c2354f45aa420792a659583 @caridy caridy committed Jul 19, 2013
View
@@ -159,7 +159,7 @@ exports.start = function (json, options, buildCallback) {
Object.keys(json.builds).forEach(function (name) {
var mod = json.builds[name];
- if (!mod.skinnable && !(mod.config && mod.config.skinnable)) {
+ if (!mod.skinnable && !(mod.config && mod.config.skinnable) && mod.assets !== false) {
mod.assets = !hasSkin;
}
if (!options.modules || has(options.modules, name)) {
View
@@ -102,6 +102,27 @@ var tests = {
'coverage should be same': function(err, results) {
assert.equal(results.pre['yql-coverage.js'], results.post['yql-coverage.js']);
}
+ },
+ 'should respect mod.assets=false and': {
+ topic: function() {
+ var self = this;
+ fs.stat(path.join(buildBase, 'yql', 'assets'), function (err) {
+ self.callback(null, err);
+ });
+ },
+ 'should not create build/yql/assets': function(foo, err) {
+ assert.isNotNull(err);
+ assert.equal(err.code, 'ENOENT');
+ }
+ },
+ 'should copy assets in postbuild and': {
+ topic: function() {
+ fs.stat(path.join(buildBase, 'yql2', 'assets'), this.callback);
+ },
+ 'should create build/yql2/assets': function(err, stat) {
+ assert.isNull(err);
+ assert.isTrue(stat.isDirectory());
+ }
}
}
}
@@ -178,6 +178,15 @@ function createTests(buildSkin) {
assert.isTrue(stat.toString().indexOf('http://foobar.com/baz/calendar/assets/skins/sam/my-image.png') > -1);
}
};
+ context['should create calendar-base/assets dir and'] = {
+ topic: function() {
+ fs.stat(path.join(buildBase, 'calendar-base', 'assets'), this.callback);
+ },
+ 'should override mod.assets=false when skinnable': function(err, stat) {
+ assert.isNull(err);
+ assert.isTrue(stat.isDirectory());
+ }
+ };
} else {
context['should not create assets dir and'] = {
topic: function() {
@@ -2,6 +2,7 @@
"name": "calendar",
"builds": {
"calendar-base": {
+ "assets": false,
"jsfiles": [
"calendar-base.js"
]
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -5,6 +5,7 @@
],
"builds": {
"yql": {
+ "assets": false,
"exec": [
"shifter --config test.json --no-global-config",
"echo 'Foobar'"
@@ -5,6 +5,7 @@
],
"builds": {
"yql": {
+ "assets": false,
"jsfiles": [
"yql.js"
]
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e2233b0

Please sign in to comment.