MCPcopy Index your code
hub / github.com/deployd/deployd / notifyType

Function notifyType

lib/resources/internal-resources.js:292–320  ·  view source on GitHub ↗
(id, event, config, server, fn)

Source from the content-addressed store, hash-verified

290};
291
292function 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
322function deleteEmptySubdirs(basepath, id) {
323 // go through a list of potentially leftover directories

Callers 2

writeFileFunction · 0.85

Calls 2

debugFunction · 0.85
fnFunction · 0.85

Tested by

no test coverage detected