* Convert all JSON configurations (*.json) to HJSON (*.hjson) which is much more flexible for a human readable and editable configuration format

* WIP "next" vs "action" changes
* options.cls is now defaulted in config.js/config.hjson (default = true)
* Notes/etc.
This commit is contained in:
Bryan Ashby 2015-09-08 22:08:45 -06:00
parent 052cf5c490
commit ca4b99a83e
10 changed files with 163 additions and 108 deletions

View file

@ -9,6 +9,7 @@ var fs = require('fs');
var Gaze = require('gaze').Gaze;
var stripJsonComments = require('strip-json-comments');
var assert = require('assert');
var hjson = require('hjson');
module.exports = exports = new JSONCache();
@ -21,9 +22,11 @@ function JSONCache() {
this.reCacheJSONFromFile = function(filePath, cb) {
fs.readFile(filePath, { encoding : 'utf-8' }, function fileRead(err, data) {
try {
self.cache[filePath] = JSON.parse(stripJsonComments(data));
//self.cache[filePath] = JSON.parse(stripJsonComments(data));
self.cache[filePath] = hjson.parse(data);
cb(null, self.cache[filePath]);
} catch(e) {
console.log(e)
cb(e);
}
});