custom-module: add filename to error traces, add support for node/electron --inspect switch

This commit is contained in:
jean-emmanuel 2019-03-31 18:50:43 +02:00
parent dabd01fca4
commit 55ff84b7cb
2 changed files with 5 additions and 2 deletions

View file

@ -83,5 +83,6 @@ module.exports = {
}
},
'instance-name':{type:'string',describe:'used to differenciate multiple instances in a zeroconf network'},
'fullscreen':{type:'boolean', describe:'launch in fullscreen mode (only affects the default gui, F11 to exit)'}
'fullscreen':{type:'boolean', describe:'launch in fullscreen mode (only affects the default gui, F11 to exit)'},
'inspect':{type:'string', hidden: true}
}

View file

@ -66,7 +66,9 @@ class OscServer {
})
try {
mod = vm.runInContext(file, context)
mod = vm.runInContext(file, context, {
filename: customModule[0]
})
if (context.module.exports) mod = context.module.exports
} catch(err) {
console.error(err)