diff --git a/Gruntfile.js b/Gruntfile.js index 33d1499..053f75d 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -9,9 +9,86 @@ module.exports = function(grunt) { commitFiles: ['package.json', 'bower.json'], pushTo: 'origin' } - } + }, + copy: { + prepare: { + files: [{ + src: [ + '**', + '!node_modules/**', + '!bower_components/**', + '!Contributing.md', + '!Gruntfile.js', + '!License.md', + '!Readme.md', + '!bower.json', + '!package.json' + ], + dest: 'temp/' + },{ + expand: true, + cwd: 'node_modules/shower-core/', + src: [ + '**', + '!package.json', + '!Readme.md' + ], + dest: 'temp/shower/' + },{ + expand: true, + cwd: 'node_modules/shower-ribbon/', + src: [ + '**', + '!package.json', + '!Readme.md' + ], + dest: 'temp/shower/themes/ribbon/' + },{ + expand: true, + cwd: 'node_modules/shower-bright/', + src: [ + '**', + '!package.json', + '!Readme.md' + ], + dest: 'temp/shower/themes/bright/' + }] + } + }, + replace: { + core: { + src: 'temp/index.html', + overwrite: true, + replacements: [{ + from: /(node_modules|bower_components)\/shower-core/g, + to: 'shower' + },{ + from: /(node_modules|bower_components)\/shower-(ribbon|bright)/g, + to: 'shower/themes/$2' + }] + }, + themes: { + src: 'temp/shower/themes/*/index.html', + overwrite: true, + replacements: [{ + from: '../shower-core', to: '../..' + }] + } + }, + 'gh-pages': { + options: { + base: 'temp' + }, + src: ['**'] + }, + clean: ['temp'] }); - grunt.registerTask('default', ['bump']); + grunt.registerTask('publish', [ + 'copy', + 'replace', + 'gh-pages', + 'clean' + ]); }; \ No newline at end of file diff --git a/package.json b/package.json index c7bc98a..bf37969 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,10 @@ "devDependencies": { "grunt": "^0.4.4", "grunt-bump": "0.0.13", + "grunt-contrib-clean": "^0.5.0", + "grunt-contrib-copy": "^0.5.0", + "grunt-gh-pages": "^0.9.1", + "grunt-text-replace": "^0.3.11", "load-grunt-tasks": "^0.4.0" } }