-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
107 lines (99 loc) · 2.89 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
/*!
* Hedgehog site Gruntfile
* https://github.com/banguit/hedgehog-site
* Copyright 2014 Dmitry Antonenko
*/
module.exports = function(grunt) {
'use strict';
// Configure
grunt.initConfig({
// Metadata.
pkg: grunt.file.readJSON('package.json'),
shell: {
// Compile scripts
compile: {
command: 'sh compile.sh'
},
compile_hedgehog_bootstrap: {
command: [
'cd libs/hedgehog-bootstrap',
'grunt'
].join('&&')
}
},
copy: {
hedgehog_bootstrap_dist: {
expand: true,
cwd: 'libs/hedgehog-bootstrap/dist',
src: ['**'],
dest: 'dist/assets'
},
hbs: {
expand: true,
cwd: 'app',
src: '*.hbs',
dest: 'dist'
},
html: {
expand: true,
cwd: 'app',
src: '*.html',
dest: 'dist'
},
hbs_partials: {
expand: true,
cwd: 'app/partials',
src: '**',
dest: 'dist/partials/'
},
package_json: {
src: 'app/package.json',
dest: 'dist/package.json'
},
theme: {
expand: true,
cwd: 'dist',
src: ['**'],
dest: 'ghost/content/themes/hedgehog'
}
},
clean: {
dist: ['dist/*'],
ghost_theme: ['ghost/content/themes/hedgehog/*']
},
watch: {
scripts: {
files: ['app/*.js', 'app/**/*.js', 'app/views/*.soy'],
tasks: ['shell:compile', 'clean:ghost_theme', 'copy:theme']
},
less: {
files: ['libs/hedgehog-bootstrap/less/*.less'],
tasks: ['shell:compile_hedgehog_bootstrap', 'copy:hedgehog_bootstrap_dist', 'clean:ghost_theme', 'copy:theme']
},
hbs: {
files: ['app/*.hbs', 'app/**/*.hbs'],
tasks: ['copy:hbs', 'copy:hbs_partials', 'copy:theme']
}
}
});
// Load tasks
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-watch');
// Register default tasks
grunt.registerTask('default',
[
'clean:dist',
'clean:ghost_theme',
'shell:compile',
'shell:compile_hedgehog_bootstrap',
'copy:hedgehog_bootstrap_dist',
'copy:hbs',
'copy:hbs_partials',
'copy:html',
'copy:package_json',
'copy:theme'
]
);
};