homey-lib
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -393,2 +393,21 @@ var fs = require('fs'); | ||
// validate env.json | ||
var env_path = path.join( this.app_path, 'env.json'); | ||
if( fs.existsSync( env_path ) ) { | ||
try { | ||
var env = fs.readFileSync( env_path ); | ||
env = JSON.parse(env); | ||
for( var key in env ) { | ||
var value = env[key]; | ||
if( key.toUpperCase() != key ) error('env.json key `' + key + '` must be uppercase'); | ||
if( typeof value != 'string' ) error('env.json `' + key + '` must be of type string'); | ||
} | ||
} catch(e){ | ||
error('invalid JSON for env.json [' + e.toString() + ']') | ||
} | ||
} | ||
@@ -395,0 +414,0 @@ return result; |
{ | ||
"name": "homey-lib", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "Library for Homey", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
65600
382