Fix watching registration file before creation
This commit is contained in:
@@ -78,10 +78,14 @@ function readRegistration() {
|
||||
/** @type {import("../types").AppServiceRegistrationConfig} */ // @ts-ignore
|
||||
let reg = readRegistration()
|
||||
|
||||
fs.watch(registrationFilePath, {persistent: false}, () => {
|
||||
let newReg = readRegistration()
|
||||
Object.assign(reg, newReg)
|
||||
})
|
||||
if (reg) {
|
||||
fs.watch(registrationFilePath, {persistent: false}, () => {
|
||||
let newReg = readRegistration()
|
||||
if (newReg) {
|
||||
Object.assign(reg, newReg)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
module.exports.registrationFilePath = registrationFilePath
|
||||
module.exports.readRegistration = readRegistration
|
||||
|
||||
Reference in New Issue
Block a user