Skip to content

Commit 56ccacf

Browse files
committed
Merge pull request jquery#119 from turanuk/nanoc-task
Modifying to add nanoc-compile task to grunt
2 parents bf3d108 + f3ddae8 commit 56ccacf

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

grunt.js

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
1+
var cp = require("child_process");
2+
13
module.exports = function( grunt ) {
24

35
grunt.loadNpmTasks( "grunt-clean" );
46
grunt.loadNpmTasks( "grunt-html" );
57
grunt.loadNpmTasks( "grunt-wordpress" );
68
grunt.loadNpmTasks( "grunt-jquery-content" );
79

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+
823
grunt.initConfig({
924
clean: {
1025
folder: "dist/"
@@ -39,7 +54,7 @@ grunt.initConfig({
3954
});
4055

4156
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");
4358
grunt.registerTask( "deploy", "wordpress-deploy" );
4459

4560
};

0 commit comments

Comments
 (0)