Permalink
Browse files

Add --no-assets option to disable skin building and asset copying. In…

…tended to be used when managing the skin/assets by another tool (e.g. a CSS preprocessor like Compass).
  • Loading branch information...
1 parent 999b021 commit d67602bfd29e49b323813576de48a5f81183b524 @unkillbob unkillbob committed Apr 18, 2013
Showing with 13 additions and 6 deletions.
  1. +3 −2 lib/args.js
  2. +1 −0 lib/help.js
  3. +6 −4 lib/module.js
  4. +3 −0 lib/walk.js
View
@@ -1,6 +1,7 @@
var nopt = require('nopt'),
known = {
'ant': Boolean,
+ 'assets': Boolean,
'build-dir': String,
'cache': Boolean,
'clean': Boolean,
@@ -31,7 +32,6 @@ var nopt = require('nopt'),
'walk': Boolean,
'watch': Boolean,
'yui-module': require('path')
-
},
shorts = {
"c": ["--config"],
@@ -79,6 +79,7 @@ var setDefaults = function(parsed) {
parsed.color = (parsed.color === undefined || parsed.color) ? true : false;
parsed['global-config'] = (parsed['global-config'] === undefined || parsed['global-config']) ? true : false;
parsed.istanbul = (parsed.istanbul === undefined || parsed.istanbul) ? true : false;
+ parsed.assets = (parsed.assets === undefined || parsed.assets) ? true : false;
//Default false
parsed.semi = (parsed.semi === undefined || parsed.semi === false) ? false : true;
@@ -89,7 +90,7 @@ var setDefaults = function(parsed) {
parsed['lint-stderr'] = (parsed['lint-stderr'] === undefined || parsed['lint-stderr'] === false) ? false : true;
parsed.progress = (parsed.progress === undefined || parsed.progress === false) ? false : true;
parsed.recursive = (parsed.recursive === undefined || parsed.recursive === false) ? false : true;
-
+
if (parsed.recursive) {
parsed.walk = true;
}
View
@@ -79,6 +79,7 @@ if (args.help) {
console.log(' --no-global-config Do not search for a .shifter.json file up the working path');
console.log(' --cssproc <base url> Use the cssproc tool to create absolute URLs for CSS assets (combohander)');
console.log(' --yui-module [file] Specify a raw yui module file to be built. The file should contain a `YUI.add()` statement.');
+ console.log(' --no-assets Do not build skins or copy across assets folders (e.g. if externally managing skin building via CSS preprocessor)');
console.log('CLI Replacers:');
console.log(' You can pass --replace-??=?? and shifter will attempt to replace these strings during the build');
console.log(' You MUST use the = to tell nopt that you want to assign the value to the dynamic option.');
View
@@ -698,10 +698,12 @@ var build = function (mod, name, options, callback) {
if (options.cssproc) {
mod.cssproc = options.cssproc;
}
- if ((mod.config && mod.config.skinnable) || mod.skinnable) {
- exports.skin(mod, name, stack.add(noop));
- } else if (mod.assets) {
- copyAssets(mod, name, stack.add(noop));
+ if (options.assets) {
+ if ((mod.config && mod.config.skinnable) || mod.skinnable) {
+ exports.skin(mod, name, stack.add(noop));
+ } else if (mod.assets) {
+ copyAssets(mod, name, stack.add(noop));
+ }
}
if (mod.config && mod.config.lang) {
exports.lang(mod, name, stack.add(noop));
View
@@ -85,6 +85,9 @@ exports.run = function (options, callback) {
if (options.strict) {
args.push('--strict');
}
+ if (options.assets === false) {
+ args.push('--no-assets');
+ }
if (options['build-dir']) {
args.push('--build-dir');

0 comments on commit d67602b

Please sign in to comment.