Skip to content

Commit

Permalink
make sure theme environment setting is used when compiling css
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbender committed Jun 5, 2012
1 parent 49958dc commit 4d9ec56
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions build/config.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var fs = require( 'fs' ),
glob = require( 'glob-whatev' ); glob = require( 'glob-whatev' );


module.exports = function( grunt ) { module.exports = function( grunt ) {
var dirs, names, min = {}, cssmin = {}, rootFile, structureFile, themeFile; var dirs, names, min = {}, cssmin = {}, theme, rootFile, structureFile, themeFile;


dirs = { dirs = {
output: 'compiled', output: 'compiled',
Expand All @@ -27,6 +27,10 @@ module.exports = function( grunt ) {
structureFile = outputPath( names.structure ); structureFile = outputPath( names.structure );
themeFile = outputPath( names.theme ); themeFile = outputPath( names.theme );


// TODO again, I'd like to use grunt params but I'm not sure
// how to get that working with a custom task with deps
theme = process.env.THEME || 'default';

// Project configuration. // Project configuration.
grunt.config.init({ grunt.config.init({
jshint: { jshint: {
Expand Down Expand Up @@ -78,8 +82,8 @@ module.exports = function( grunt ) {
}, },


structure: { structure: {
src: [ '<banner:global.ver.header>', outputPath( names.structure ) + '.compiled.css' ], src: [ '<banner:global.ver.header>', structureFile + '.compiled.css' ],
dest: outputPath( names.structure ) + '.css' dest: structureFile + '.css'
}, },


regular: { regular: {
Expand All @@ -90,9 +94,9 @@ module.exports = function( grunt ) {
theme: { theme: {
src: [ src: [
'<banner:global.ver.header>', '<banner:global.ver.header>',
'css/themes/default/jquery.mobile.theme.css' 'css/themes/' + theme + '/jquery.mobile.theme.css'
], ],
dest: outputPath( names.theme ) + '.css' dest: themeFile + '.css'
} }
}, },


Expand Down

0 comments on commit 4d9ec56

Please sign in to comment.