Merge pull request #851 from matthijskooijman/custom-module-reload-function
custom-module: Call reload() function on auto-reload
This commit is contained in:
commit
a21e789437
3 changed files with 22 additions and 5 deletions
|
|
@ -195,6 +195,15 @@ class CustomModule {
|
|||
console.log('(INFO) Reloading custom module...')
|
||||
if (this.load()) {
|
||||
console.log('(INFO) Custom module reloaded successfully')
|
||||
|
||||
if (this.module.exports && this.module.exports.reload) {
|
||||
try {
|
||||
this.module.exports.reload()
|
||||
} catch(e) {
|
||||
console.error('(ERROR) Error while calling custom module reload function')
|
||||
console.error(e)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.error('(ERROR) Failed to reload custom module')
|
||||
this.unload()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue