-
Notifications
You must be signed in to change notification settings - Fork 27
/
Gruntfile.js
101 lines (91 loc) · 2.06 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
/*
|--------------------------------------------------------------------------
| Centurion Grunt File
|--------------------------------------------------------------------------
|
| If you would like to edit the color of your Centurion file just change
| the color of 'config.hero'. There are some predefined colors here
| already but feel free to just throw your own one in.
|
*/
module.exports = function(grunt) {
// Load tasks
require('load-grunt-tasks')(grunt);
var config = {
green:[96,172,123],
blue:[108,166,206],
red:[197,91,78],
yellow:[225,174,105],
orange:[225,134,90],
grey:[120,120,120],
folderName:'Theme - Centurion'
}
config.hero = config.green;
// Grunt Config
grunt.initConfig({
concat: {
options: {
banner:'[',
footer:',{"class": "grunt"}]',
separator:',\n'
},
dist: {
files: {
'Centurion.json': ['src/dark/*'],
'CenturionLight.json': ['src/light/*']
}
},
},
'string-replace': {
dist: {
files: {
'Centurion.sublime-theme':['Centurion.json'],
'CenturionLight.sublime-theme':['CenturionLight.json'],
'Centurion/Widget - Centurion.sublime-settings':['settings.json'],
'Centurion/Widget - CenturionLight.sublime-settings':['settingsLight.json']
},
options: {
replacements: [{
pattern: /\{\{(.*?)\}\}/ig,
replacement: function (match, p1, offset, string) {
var replace = config[p1]
if(typeof replace === 'object'){
return JSON.stringify(replace);
}
return replace;
}
}]
}
}
},
watch: {
scripts: {
files: ['**/*.json'],
tasks: ['default'],
options: {
spawn: false,
},
},
},
comments: {
your_target: {
options: {
singleline: true,
multiline: true
},
src: ['Centurion.sublime-theme','CenturionLight.sublime-theme']
}
},
jsonlint: {
validate: {
src: [ 'Centurion.sublime-theme' ]
}
}
});
grunt.registerTask('default', [
'concat',
'string-replace',
'comments',
'jsonlint'
]);
};