File tree 1 file changed +16
-1
lines changed
1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change
1
+ var cp = require ( "child_process" ) ;
2
+
1
3
module . exports = function ( grunt ) {
2
4
3
5
grunt . loadNpmTasks ( "grunt-clean" ) ;
4
6
grunt . loadNpmTasks ( "grunt-html" ) ;
5
7
grunt . loadNpmTasks ( "grunt-wordpress" ) ;
6
8
grunt . loadNpmTasks ( "grunt-jquery-content" ) ;
7
9
10
+ grunt . registerTask ( "nanoc-compile" , "compiles nanoc" , function ( ) {
11
+ console . log ( "Doing 'nanoc compile' in '" + __dirname + "'" ) ;
12
+ var done = this . async ( ) ;
13
+ cp . exec ( "nanoc compile" , function ( error , stdout , stderr ) {
14
+ console . log ( stdout ) ;
15
+ if ( error !== null ) {
16
+ console . error ( error ) ;
17
+ process . exit ( error . code ) ;
18
+ }
19
+ done ( ) ;
20
+ } ) ;
21
+ } ) ;
22
+
8
23
grunt . initConfig ( {
9
24
clean : {
10
25
folder : "dist/"
@@ -39,7 +54,7 @@ grunt.initConfig({
39
54
} ) ;
40
55
41
56
grunt . registerTask ( "default" , "lint" ) ;
42
- grunt . registerTask ( "build-wordpress" , "clean lint build-pages build-resources" ) ;
57
+ grunt . registerTask ( "build-wordpress" , "clean lint nanoc-compile build-pages build-resources" ) ;
43
58
grunt . registerTask ( "deploy" , "wordpress-deploy" ) ;
44
59
45
60
} ;
You can’t perform that action at this time.
0 commit comments