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

Commit

Permalink
Fixes #37
Browse files Browse the repository at this point in the history
  • Loading branch information
luboskmetko committed Jul 15, 2014
1 parent c86111e commit 135a2f7
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 22 deletions.
11 changes: 11 additions & 0 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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');
Expand Down
45 changes: 38 additions & 7 deletions app/templates/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -167,7 +188,7 @@ module.exports = function(grunt) {
wp: {
cwd: '<%%= xh.dist %>/',
src: ['**', '!_xprecise', '!*.html'],
src: ['**', '!**/_xprecise/**', '!*.html'],
dest: '<%= wpThemeFolder %>',
expand: true
},<% } %>
Expand Down Expand Up @@ -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
}
}
}

Expand All @@ -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') { %>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ nbproject
.tmp
node_modules
bower_components<% if (ignoreDist) { %>
dist <% } %>
dist<% } %>

# Other
validation-report.json
Expand Down
Binary file added app/templates/src/img/do_not_delete_me.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions test/test-defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ describe('XH generator defaults', function () {
'src/scss/_variables.scss',
'src/scss/_wordpress.scss',
'src/scss/main.scss',
'dist',
'dist/_xprecise',
'dist/css',
'dist/fonts',
'dist/img',
'dist/media',
'dist/js',
'dist/js/PIE.htc'
'src/fonts',
'src/img',
'src/media',
'src/xprecise',
'src/fonts/do_not_delete_me.png',
'src/img/do_not_delete_me.png',
'src/media/do_not_delete_me.png',
'src/xprecise/do_not_delete_me.png'
];

helpers.mockPrompt(this.app, {
Expand Down
14 changes: 8 additions & 6 deletions test/test-less.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ describe('XH generator Less', function () {
'src/less/mixins.less',
'src/less/variables.less',
'src/less/main.less',
'dist',
'dist/_xprecise',
'dist/css',
'dist/img',
'dist/media',
'dist/js'
'src/fonts',
'src/img',
'src/media',
'src/xprecise',
'src/fonts/do_not_delete_me.png',
'src/img/do_not_delete_me.png',
'src/media/do_not_delete_me.png',
'src/xprecise/do_not_delete_me.png'
];

helpers.mockPrompt(this.app, {
Expand Down

0 comments on commit 135a2f7

Please sign in to comment.