bmstu-mt-wp/Gruntfile.js

116 lines
2.0 KiB
JavaScript
Raw Normal View History

module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
bump: {
options: {
files: ['package.json', 'bower.json'],
commitFiles: ['package.json', 'bower.json'],
pushTo: 'origin'
}
2014-05-09 17:31:40 +04:00
},
copy: {
prepare: {
files: [{
src: [
'**',
'!node_modules/**',
'!bower_components/**',
'!Contributing.md',
'!Gruntfile.js',
'!License.md',
'!Readme.md',
'!bower.json',
'!package.json'
],
2014-05-09 18:56:00 +04:00
dest: 'temp/pres/'
2014-05-09 17:31:40 +04:00
},{
expand: true,
cwd: 'node_modules/shower-core/',
src: [
'**',
'!package.json',
'!Readme.md'
],
2014-05-09 18:56:00 +04:00
dest: 'temp/pres/shower/'
2014-05-09 17:31:40 +04:00
},{
expand: true,
cwd: 'node_modules/shower-ribbon/',
src: [
'**',
'!package.json',
'!Readme.md'
],
2014-05-09 18:56:00 +04:00
dest: 'temp/pres/shower/themes/ribbon/'
2014-05-09 17:31:40 +04:00
},{
expand: true,
cwd: 'node_modules/shower-bright/',
src: [
'**',
'!package.json',
'!Readme.md'
],
2014-05-09 18:56:00 +04:00
dest: 'temp/pres/shower/themes/bright/'
2014-05-09 17:31:40 +04:00
}]
}
},
replace: {
core: {
2014-05-09 18:56:00 +04:00
src: 'temp/pres/index.html',
2014-05-09 17:31:40 +04:00
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: {
2014-05-09 18:56:00 +04:00
src: 'temp/pres/shower/themes/*/index.html',
2014-05-09 17:31:40 +04:00
overwrite: true,
replacements: [{
from: '../shower-core', to: '../..'
}]
}
},
'gh-pages': {
options: {
2014-05-09 18:56:00 +04:00
base: 'temp/pres',
clone: 'temp/clone'
2014-05-09 17:31:40 +04:00
},
src: ['**']
},
2014-05-27 15:02:58 +04:00
compress: {
shower: {
options: {
archive: 'archive.zip'
},
files: [{
expand: true,
cwd: 'temp/pres/',
src: '**',
dest: '.'
}]
}
},
2014-05-09 17:31:40 +04:00
clean: ['temp']
});
2014-05-09 17:31:40 +04:00
grunt.registerTask('publish', [
'copy',
'replace',
'gh-pages',
'clean'
]);
2014-05-27 15:02:58 +04:00
grunt.registerTask('archive', [
'copy',
'replace',
'compress',
'clean'
]);
};