grunt-google-cdn
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -14,3 +14,4 @@ var replacements = exports.replacements = {}; | ||
]; | ||
var angularVersions = ['1.0.6','1.0.5', '1.0.4', '1.0.3', '1.0.2', '1.0.1']; | ||
var angularVersions = ['1.0.6','1.0.5', '1.0.4', '1.0.3', '1.0.2', '1.0.1', '1.1.4', '1.1.3']; | ||
angularFiles.forEach(function (file) { | ||
@@ -34,3 +35,3 @@ versions[file] = angularVersions; | ||
// scraped from: https://developers.google.com/speed/libraries/devguide | ||
versions.jquery = ['1.9.1', '1.9.0', '1.8.3', '1.8.2', '1.8.1', '1.8.0', '1.7.2', '1.7.1', '1.7.0', '1.6.4', '1.6.3', '1.6.2', '1.6.1', '1.6.0', '1.5.2', '1.5.1', '1.5.0', '1.4.4', '1.4.3', '1.4.2', '1.4.1', '1.4.0', '1.3.2', '1.3.1', '1.3.0', '1.2.6', '1.2.3']; | ||
versions.jquery = ['2.0.0', '1.9.1', '1.9.0', '1.8.3', '1.8.2', '1.8.1', '1.8.0', '1.7.2', '1.7.1', '1.7.0', '1.6.4', '1.6.3', '1.6.2', '1.6.1', '1.6.0', '1.5.2', '1.5.1', '1.5.0', '1.4.4', '1.4.3', '1.4.2', '1.4.1', '1.4.0', '1.3.2', '1.3.1', '1.3.0', '1.2.6', '1.2.3']; | ||
replacements['jquery'] = { | ||
@@ -37,0 +38,0 @@ from: 'components/jquery/jquery.js', |
{ | ||
"name": "grunt-google-cdn", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Grunt task for replacing refs to resources on the Google CDN", | ||
@@ -5,0 +5,0 @@ "main": "Gruntfile.js", |
'use strict'; | ||
var semver = require('semver'); | ||
var fs = require('fs'); | ||
var hoist = require('../util/hoist.js'); | ||
@@ -15,2 +16,16 @@ | ||
function readBowerJson() { | ||
var bowerrc = {}; | ||
var componentsFilename; | ||
// Read bowerrc first, if present | ||
if (fs.existsSync('.bowerrc')) { | ||
bowerrc = grunt.file.readJSON('.bowerrc'); | ||
} | ||
// If bowerrc defines a 'json' attribute, use that | ||
componentsFilename = bowerrc.json || 'components.json'; | ||
return grunt.file.readJSON(componentsFilename); | ||
} | ||
grunt.registerMultiTask('cdnify', 'replace scripts with refs to the Google CDN', function () { | ||
@@ -21,5 +36,4 @@ var options = this.options(); | ||
var dest = options.dest; | ||
var compJson = readBowerJson(); | ||
var compJson = grunt.file.readJSON('component.json'); | ||
grunt.log | ||
@@ -26,0 +40,0 @@ .writeln('Going through ' + grunt.log.wordlist(files) + ' to update script refs'); |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
6579
167
1