Skip to content
This repository has been archived by the owner on Apr 21, 2021. It is now read-only.

Fixes #52 #55

Merged
merged 1 commit into from
Aug 5, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@ var XhGenerator = yeoman.generators.Base.extend({
this.pkg = require('../package.json');

this.on('end', function () {
// http://stackoverflow.com/questions/18841273/how-to-run-a-grunt-task-after-my-yeoman-generator-finishes-installing
this.installDependencies({
skipInstall: this.options['skip-install'],
callback: function () {
this.spawnCommand('grunt', ['postinstall']);
}.bind(this) // bind the callback to the parent scope
skipInstall: this.options['skip-install']
});
});
},
Expand Down
29 changes: 15 additions & 14 deletions app/templates/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,16 @@ module.exports = function(grunt) {
jquery: {
cwd: 'src/bower_components/jquery/dist/',
src: 'jquery.min.js',
dest: '<%%= xh.src %>/js/',
dest: '<%%= xh.dist %>/js/',
expand: true
},
},<% if (!useModernizr) { %>,

shiv: {
cwd: 'src/bower_components/html5shiv/dist/',
src: 'html5shiv.min.js',
dest: '<%%= xh.dist %>/js/',
expand: true
},<% } %>

fonts: {
cwd: '<%%= xh.src %>/fonts/',
Expand Down Expand Up @@ -181,7 +188,7 @@ module.exports = function(grunt) {

js: {
cwd: '<%%= xh.src %>/js/',
src: ['main.js', 'jquery.min.js', <% if (useModernizr) { %>'modernizr.min.js'<% } else { %>'html5shiv.min.js'<% } %>],
src: ['main.js'],
dest: '<%%= xh.dist %>/js/',
expand: true
},<% if (isWP) { %>
Expand All @@ -207,14 +214,7 @@ module.exports = function(grunt) {
src: '<%%= xh.build %>',
dest: '<%%= xh.src %>/includes/',
expand: true
}<% if (!useModernizr) { %>,

shiv: {
cwd: 'src/bower_components/html5shiv/dist/',
src: 'html5shiv.min.js',
dest: '<%%= xh.src %>/js/',
expand: true
}<% } %>
}
},

jshint: {
Expand All @@ -230,7 +230,7 @@ module.exports = function(grunt) {
uglify: {
modernizr: {
files: {
'<%%= xh.src %>/js/modernizr.min.js': ['src/bower_components/modernizr/modernizr.js']
'<%%= xh.dist %>/js/modernizr.min.js': ['src/bower_components/modernizr/modernizr.js']
}
}
},<% } %>
Expand Down Expand Up @@ -410,8 +410,7 @@ module.exports = function(grunt) {
'copy:xprecise'
]);

grunt.registerTask('build-css', [
<% if (cssPreprocessor === 'SCSS') { %>
grunt.registerTask('build-css', [<% if (cssPreprocessor === 'SCSS') { %>
'sass',<% } %><% if (cssPreprocessor === 'LESS') { %>
'less',<% } %>
'autoprefixer',
Expand All @@ -429,6 +428,7 @@ module.exports = function(grunt) {

grunt.registerTask('build', [
'clean:dist',
'postinstall',

'build-html',
'build-assets',
Expand Down Expand Up @@ -456,6 +456,7 @@ module.exports = function(grunt) {
]);

grunt.registerTask('default', [
'postinstall',
'watch'
]);
};
3 changes: 0 additions & 3 deletions app/templates/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,5 @@
"grunt-text-replace": "^0.3.11",
"grunt-search": "^0.1.4",
"grunt-autoprefixer": "^0.7.3"
},
"scripts": {
"postinstall": "grunt postinstall"
}
}