-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build: Remove dependency on grunt-wordpress
This 20-line grunt plugin is a very thin wrapper around gilded-wordpress and node-wordpress. For ease of maintenance, use these directly here. None of scripts and other code is copied from the grunt-wordpress repository, only the grunt task itself. Reformatted per current jQuery code conventions to satisfy the ESLint preset. Ref jquery/api.jquery.com#1119
- Loading branch information
Showing
6 changed files
with
205 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
"use strict"; | ||
|
||
const wordpress = require( "gilded-wordpress" ); | ||
|
||
module.exports = function( grunt ) { | ||
|
||
var client = ( function() { | ||
var _client; | ||
|
||
return function() { | ||
if ( !_client ) { | ||
var config = grunt.config( "wordpress" ); | ||
config.verbose = grunt.option( "verbose" ) || false; | ||
|
||
_client = wordpress.createClient( config ); | ||
_client.log = function() { | ||
grunt.log.writeln.apply( grunt.log, arguments ); | ||
}; | ||
_client.logError = function() { | ||
grunt.log.error.apply( grunt.log, arguments ); | ||
}; | ||
} | ||
|
||
return _client; | ||
}; | ||
} )(); | ||
|
||
grunt.registerTask( "wordpress-validate", function() { | ||
client().validate( this.async() ); | ||
} ); | ||
|
||
grunt.registerTask( "wordpress-sync", function() { | ||
this.requires( "wordpress-validate" ); | ||
client().sync( this.async() ); | ||
} ); | ||
|
||
grunt.registerTask( "wordpress-publish", [ "wordpress-validate", "wordpress-sync" ] ); | ||
grunt.registerTask( "wordpress-deploy", [ "build-wordpress", "wordpress-publish" ] ); | ||
grunt.registerTask( "deploy", [ "wordpress-deploy" ] ); | ||
|
||
}; |