main: allow passing extra options to --custom-module and make them available through global object "options"

This commit is contained in:
jean-emmanuel 2019-01-03 17:54:54 +01:00
parent c5610cc688
commit 6b7bdcf0a0
5 changed files with 9 additions and 5 deletions

View file

@ -17,11 +17,12 @@ class OscServer {
this.customModuleEventEmitter = new EventEmitter()
this.customModule = (()=>{
if (!settings.read('customModule')) return false
var customModule = settings.read('customModule')
if (!customModule) return false
var file = (()=>{
try {
return fs.readFileSync(settings.read('customModule'),'utf8')
return fs.readFileSync(customModule[0], 'utf8')
} catch(err) {
console.log('CustomModule Error: File not found: ' + settings.read('customModule'))
return false
@ -37,7 +38,8 @@ class OscServer {
clearTimeout,
setInterval,
clearInterval,
settings
settings,
options: customModule.slice(1, customModule.length)
}
try {