Allow node modules to include example flows

This commit is contained in:
Nick O'Leary
2016-03-02 23:34:24 +00:00
parent dcd8b3699c
commit 55e66ebcac
7 changed files with 142 additions and 17 deletions

View File

@@ -1,5 +1,5 @@
/**
* Copyright 2015 IBM Corp.
* Copyright 2015, 2016 IBM Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -174,6 +174,8 @@ function uninstallModule(module) {
} else {
log.info(log._("server.install.uninstalled",{name:module}));
reportRemovedModules(list);
// TODO: tidy up internal event names
events.emit("node-module-uninstalled",module)
resolve(list);
}
}

View File

@@ -184,6 +184,12 @@ function getModuleNodeFiles(module) {
}
}
}
var examplesDir = path.join(moduleDir,"examples");
try {
fs.statSync(examplesDir)
events.emit("node-examples-dir",{name:pkg.name,path:examplesDir});
} catch(err) {
}
return results;
}