1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-16 11:37:29 +02:00
video.js/tasks/cdn-links.js

14 lines
535 B
JavaScript
Raw Normal View History

module.exports = function(grunt) {
grunt.registerTask('cdn-links', 'Update the version of CDN links in docs', function(){
var doc = grunt.file.read('docs/guides/setup.md');
var version = pkg.version;
// 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);
});
};