|
1 |
| -var config = require( "./lib/config" ); |
2 |
| -var path = require( "path" ); |
| 1 | +var path = require( "path" ), |
| 2 | + rimraf = require( "rimraf" ), |
| 3 | + config = require( "./lib/config" ); |
3 | 4 |
|
4 | 5 | module.exports = function( grunt ) {
|
5 | 6 |
|
6 | 7 | var async = grunt.utils.async;
|
7 | 8 |
|
8 | 9 | grunt.loadNpmTasks( "grunt-wordpress" );
|
9 |
| -grunt.loadNpmTasks( "grunt-clean" ); |
10 | 10 | grunt.loadNpmTasks( "grunt-jquery-content" );
|
11 | 11 | grunt.loadNpmTasks( "grunt-check-modules" );
|
12 | 12 |
|
13 | 13 | grunt.initConfig({
|
14 |
| - clean: { |
15 |
| - wordpress: "dist/" |
16 |
| - }, |
17 | 14 | lint: {
|
18 | 15 | grunt: "grunt.js",
|
19 | 16 | src: [ "lib/**", "scripts/**" ]
|
@@ -42,6 +39,10 @@ grunt.initConfig({
|
42 | 39 | }, config.wordpress )
|
43 | 40 | });
|
44 | 41 |
|
| 42 | +grunt.registerTask( "clean", function() { |
| 43 | + rimraf.sync( "dist" ); |
| 44 | +}); |
| 45 | + |
45 | 46 | // We only want to sync the documentation, so we override wordpress-get-postpaths
|
46 | 47 | // to only find pages. This ensures that we don't delete all of the plugin posts.
|
47 | 48 | grunt.registerHelper( "wordpress-get-postpaths", function( fn ) {
|
@@ -113,8 +114,7 @@ grunt.registerTask( "sync-docs", function() {
|
113 | 114 | // clean-all will delete EVERYTHING, including the plugin registery. This is
|
114 | 115 | // useful only for development if you want a clean slate to test from.
|
115 | 116 | grunt.registerTask( "clean-all", function() {
|
116 |
| - var rimraf = require( "rimraf" ), |
117 |
| - retry = require( "./lib/retrydb" ); |
| 117 | + var retry = require( "./lib/retrydb" ); |
118 | 118 |
|
119 | 119 | // clean repo checkouts
|
120 | 120 | rimraf.sync( config.repoDir );
|
|
0 commit comments