Skip to content

Commit

Permalink
Merge pull request #1022 from adaptlearning/issue/1021
Browse files Browse the repository at this point in the history
Resolves #1021, passes a subset of attributes to Grunt replace task
  • Loading branch information
brian-learningpool committed Apr 19, 2016
2 parents ae7d5de + ef2d069 commit f8e115b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion grunt/config/replace.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var path = require('path');
var fs = require('fs');
var _ = require('underscore');

module.exports = function (grunt, options) {

Expand Down Expand Up @@ -37,6 +38,10 @@ module.exports = function (grunt, options) {
}
}

// Ensure that only whitelisted attributes can be replaced.
courseJson = _.pick(courseJson, 'title', 'displayTitle', 'body', 'description');
configJson = _.pick(configJson, '_xapi', '_spoor');

// Combine the course and config JSON so both can be passed to replace.
var json = {
'course': courseJson,
Expand Down Expand Up @@ -76,4 +81,4 @@ module.exports = function (grunt, options) {
}
}
}
}
}

0 comments on commit f8e115b

Please sign in to comment.