-
Notifications
You must be signed in to change notification settings - Fork 4
/
Gruntfile.js
115 lines (110 loc) · 1.98 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
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'
}
},
copy: {
prepare: {
files: [{
src: [
'**',
'!node_modules/**',
'!bower_components/**',
'!Contributing.md',
'!Gruntfile.js',
'!License.md',
'!Readme.md',
'!bower.json',
'!package.json'
],
dest: 'temp/pres/'
},{
expand: true,
cwd: 'node_modules/shower-core/',
src: [
'**',
'!package.json',
'!Readme.md'
],
dest: 'temp/pres/shower/'
},{
expand: true,
cwd: 'node_modules/shower-ribbon/',
src: [
'**',
'!package.json',
'!Readme.md'
],
dest: 'temp/pres/shower/themes/ribbon/'
},{
expand: true,
cwd: 'node_modules/shower-bright/',
src: [
'**',
'!package.json',
'!Readme.md'
],
dest: 'temp/pres/shower/themes/bright/'
}]
}
},
replace: {
core: {
src: 'temp/pres/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/pres/shower/themes/*/index.html',
overwrite: true,
replacements: [{
from: '../shower-core', to: '../..'
}]
}
},
'gh-pages': {
options: {
base: 'temp/pres',
clone: 'temp/clone'
},
src: ['**']
},
compress: {
shower: {
options: {
archive: 'archive.zip'
},
files: [{
expand: true,
cwd: 'temp/pres/',
src: '**',
dest: '.'
}]
}
},
clean: ['temp']
});
grunt.registerTask('publish', [
'copy',
'replace',
'gh-pages',
'clean'
]);
grunt.registerTask('archive', [
'copy',
'replace',
'compress',
'clean'
]);
};