2015-02-25 16:00:09 -08:00
|
|
|
module.exports = function(grunt) {
|
|
|
|
grunt.registerTask('cdn-links', 'Update the version of CDN links in docs', function(){
|
2015-05-01 12:53:51 -07:00
|
|
|
let doc = grunt.file.read('docs/guides/setup.md');
|
2016-08-17 17:16:41 -04:00
|
|
|
let version = require('../../package.json').version;
|
2015-02-25 16:00:09 -08:00
|
|
|
|
|
|
|
// remove the patch version to point to the latest patch
|
|
|
|
version = version.replace(/(\d+\.\d+)\.\d+/, '$1');
|
|
|
|
|
|
|
|
// update the version in http://vjs.zencdn.net/4.3/video.js
|
|
|
|
doc = doc.replace(/(\/\/vjs\.zencdn\.net\/)\d+\.\d+(\.\d+)?/g, '$1'+version);
|
|
|
|
grunt.file.write('docs/guides/setup.md', doc);
|
|
|
|
});
|
|
|
|
};
|