Created
August 15, 2014 22:06
-
-
Save goldsmith/85de1956e34ed93aec32 to your computer and use it in GitHub Desktop.
Revisions
-
goldsmith created this gist
Aug 15, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ grunt.registerTask('purgecdn', 'Purge MaxCDN pull zone', function() { var done = this.async(); grunt.config.requires('maxcdn'); var maxcdn = grunt.config('maxcdn'); var api = new MaxCDN( maxcdn.companyAlias, maxcdn.consumerKey, maxcdn.consumerSecret ); grunt.log.writeln('purging cache for Pull Zone #' + maxcdn.pullZoneId + '...'); api.del('zones/pull.json/' + maxcdn.pullZoneId + '/cache', function callback(err, response) { if (err) { grunt.log.error(JSON.parse(err.data).error.message); done(false); return; } grunt.log.writeln('successfully purged!'); done(); }); });