(id, event, config, server, fn)
| 290 | }; |
| 291 | |
| 292 | function notifyType(id, event, config, server, fn) { |
| 293 | if(server) { |
| 294 | var found = false; |
| 295 | server.resources.forEach(function(r) { |
| 296 | if(id === r.name) { |
| 297 | found = true; |
| 298 | debug('notifying resource', r.config.path); |
| 299 | if (r['config' + event]) { |
| 300 | r['config' + event](config, function(err) { |
| 301 | if (err) return fn(err); |
| 302 | r.config = config; |
| 303 | fn(); |
| 304 | r.emit(event.toLowerCase(), config); |
| 305 | }); |
| 306 | } else { |
| 307 | fn(); |
| 308 | r.emit(event.toLowerCase(), config); |
| 309 | } |
| 310 | return false; |
| 311 | } |
| 312 | }); |
| 313 | |
| 314 | if (!found) { |
| 315 | fn(); |
| 316 | } |
| 317 | } else { |
| 318 | fn(); |
| 319 | } |
| 320 | } |
| 321 | |
| 322 | function deleteEmptySubdirs(basepath, id) { |
| 323 | // go through a list of potentially leftover directories |
no test coverage detected