0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00

config file error handling

This commit is contained in:
Alex Kocharin 2013-09-25 13:29:39 +04:00
parent e01d30adb9
commit 11bf03f130

View file

@ -19,7 +19,12 @@ function Config(config) {
if (!(this instanceof Config)) return new Config(config); if (!(this instanceof Config)) return new Config(config);
for (var i in config) { for (var i in config) {
if (this[i] == null) this[i] = config[i]; if (this[i] == null) this[i] = config[i];
} }
// some weird shell scripts are valid yaml files parsed as string
assert.equal(typeof(config), 'object', 'CONFIG: this doesn\'t look like a valid config file');
assert(this.storage, 'CONFIG: storage path not defined');
var users = {all:true}; var users = {all:true};