Browse Source

Lowercase hierarchy names. Fixes #336

dev/git-series/gccdum
Matt Godbolt 6 years ago
parent
commit
633311fd24
  1. 15
      lib/properties.js

15
lib/properties.js

@ -23,7 +23,8 @@
// POSSIBILITY OF SUCH DAMAGE.
var fs = require('fs'),
logger = require('./logger').logger;
logger = require('./logger').logger,
_ = require('underscore-node');
var properties = {};
@ -81,8 +82,10 @@ function parseProperties(blob, name) {
function initialize(directory, hier) {
if (hier === null) throw new Error('Must supply a hierarchy array');
logger.info("Reading properties from " + directory + " with hierarchy " + hier);
hierarchy = hier;
hierarchy = _.map(hier, function (x) {
return x.toLowerCase();
});
logger.info("Reading properties from " + directory + " with hierarchy " + hierarchy);
var endsWith = /\.properties$/;
var propertyFiles = fs.readdirSync(directory).filter(function (filename) {
return filename.match(endsWith);
@ -98,7 +101,7 @@ function initialize(directory, hier) {
}
function propsFor(base) {
return function(property, defaultValue) {
return function (property, defaultValue) {
return get(base, property, defaultValue);
};
}
@ -107,5 +110,7 @@ module.exports = {
get: get,
propsFor: propsFor,
initialize: initialize,
setDebug: function(debug) { propDebug = debug; }
setDebug: function (debug) {
propDebug = debug;
}
};

Loading…
Cancel
Save