From 135a2f756b2fa5b3a817efcbefb38a488b713f92 Mon Sep 17 00:00:00 2001 From: Lubos Kmetko Date: Tue, 15 Jul 2014 13:13:21 +0200 Subject: [PATCH] Fixes #37 --- app/index.js | 11 +++++ app/templates/Gruntfile.js | 45 +++++++++++++++++---- app/templates/gitignore | 2 +- app/templates/src/img/do_not_delete_me.png | Bin 0 -> 952 bytes test/test-defaults.js | 16 ++++---- test/test-less.js | 14 ++++--- 6 files changed, 66 insertions(+), 22 deletions(-) create mode 100644 app/templates/src/img/do_not_delete_me.png diff --git a/app/index.js b/app/index.js index 1fac5d3..0fb470d 100644 --- a/app/index.js +++ b/app/index.js @@ -136,7 +136,17 @@ var XhGenerator = yeoman.generators.Base.extend({ this.mkdir('src/includes'); this.mkdir('src/js'); this.mkdir('src/fonts'); + this.mkdir('src/img'); + this.mkdir('src/img/common'); + this.mkdir('src/media'); + this.mkdir('src/xprecise'); + this.copy('src/img/do_not_delete_me.png', 'src/fonts/do_not_delete_me.png'); + this.copy('src/img/do_not_delete_me.png', 'src/img/do_not_delete_me.png'); + this.copy('src/img/do_not_delete_me.png', 'src/media/do_not_delete_me.png'); + this.copy('src/img/do_not_delete_me.png', 'src/xprecise/do_not_delete_me.png'); + + /* this.mkdir('dist'); this.mkdir('dist/fonts'); this.mkdir('dist/css'); @@ -145,6 +155,7 @@ var XhGenerator = yeoman.generators.Base.extend({ this.mkdir('dist/img/common'); this.mkdir('dist/media'); this.mkdir('dist/_xprecise'); + */ // HTML this.copy('src/_template.html', 'src/template.html'); diff --git a/app/templates/Gruntfile.js b/app/templates/Gruntfile.js index 67f4f90..2185633 100644 --- a/app/templates/Gruntfile.js +++ b/app/templates/Gruntfile.js @@ -153,11 +153,32 @@ module.exports = function(grunt) { fonts: { cwd: '<%%= xh.src %>/fonts/', - src: '*.*', + src: ['*.*', '!do_not_delete_me.png'], dest: '<%%= xh.dist %>/fonts/', expand: true }, + img: { + cwd: '<%%= xh.src %>/img/', + src: ['*.*', '!do_not_delete_me.png'], + dest: '<%%= xh.dist %>/img/', + expand: true + }, + + media: { + cwd: '<%%= xh.src %>/media/', + src: ['*.*', '!do_not_delete_me.png'], + dest: '<%%= xh.dist %>/media/', + expand: true + }, + + xprecise: { + cwd: '<%%= xh.src %>/xprecise/', + src: ['*.*', '!do_not_delete_me.png'], + dest: '<%%= xh.dist %>/_xprecise/', + expand: true + }, + js: { cwd: '<%%= xh.src %>/js/', src: 'main.js', @@ -167,7 +188,7 @@ module.exports = function(grunt) { wp: { cwd: '<%%= xh.dist %>/', - src: ['**', '!_xprecise', '!*.html'], + src: ['**', '!**/_xprecise/**', '!*.html'], dest: '<%= wpThemeFolder %>', expand: true },<% } %> @@ -354,11 +375,18 @@ module.exports = function(grunt) { } }, - fonts: { - files: ['<%%= xh.src %>/fonts/*.*'], + assets: { + files: ['<%%= xh.src %>/img/*.*', '<%%= xh.src %>/media/*.*', '<%%= xh.src %>/fonts/*.*', '<%%= xh.src %>/xprecise/*.*'], tasks: [ - 'copy:fonts' - ] + 'copy:img', + 'copy:media', + 'copy:fonts', + 'copy:xprecise', + 'copy:wp' + ], + options: { + livereload: true + } } } @@ -377,8 +405,11 @@ module.exports = function(grunt) { 'jsbeautifier:html', 'clean:tmp', - // Fonts + // Copy Assets + 'copy:img', + 'copy:media', 'copy:fonts', + 'copy:xprecise', // CSS <% if (cssPreprocessor === 'SCSS') { %> diff --git a/app/templates/gitignore b/app/templates/gitignore index 4fa32d1..c5220b6 100644 --- a/app/templates/gitignore +++ b/app/templates/gitignore @@ -33,7 +33,7 @@ nbproject .tmp node_modules bower_components<% if (ignoreDist) { %> -dist <% } %> +dist<% } %> # Other validation-report.json diff --git a/app/templates/src/img/do_not_delete_me.png b/app/templates/src/img/do_not_delete_me.png new file mode 100644 index 0000000000000000000000000000000000000000..af869f6f3f93d8bb1c8ea41fdd9bc87671467018 GIT binary patch literal 952 zcmaJ=zi!h&9KNa&sv;F;5X0dP1&R24PC{!dCM0%DBh^vl1T|wF`;u6xea5~JCj$c; z6FdUq0eAoykPr(q3u0koLgEp^IgL{Wf(PI4?!NE){k@l+_T&A+tpWgGzjb2Re9i2_ z-Y);Y|5ba%mz%8FXI(mEGbbjX?$H5(t-u)(n>gP5=@(K3VE2yS>$ARfs=71~oeU$U zLB!brRBLJExD&$QfQf0{>dUH-9@|SE+($x3AKl?nyOqN zAk2Yja1kbIstGGymD|}d65tBLCYo>=RNv}AoyG)K#7fbXWDJiK5m(9z#`mEt;S$0U zl9eLHYWYaT58(O}xVP9Fs@=amQ6Y58q}QzBxE_) zyW*N#x!EKH5%+A6*ndVmGo}GtWvu$!W6`(jt-0RzSd6V)#DhUuU;pZJe#D0-GdEMq zH=DU9As_abPxTM`?U28SYn{_xbGck{^U0^L&-t>$>~