First pass at README update.

This commit is contained in:
Nick Farina
2015-11-02 15:30:29 -08:00
parent 15cc98217b
commit 52d3a9a96e
5 changed files with 80 additions and 95 deletions

View File

@@ -59,6 +59,7 @@ Server.prototype._publish = function() {
Server.prototype._loadPlugins = function(accessories, platforms) {
var plugins = {};
var foundOnePlugin = false;
// load and validate plugins - check for valid package.json, etc.
Plugin.installed().forEach(function(plugin) {
@@ -75,17 +76,26 @@ Server.prototype._loadPlugins = function(accessories, platforms) {
plugin.loadError = err;
}
// add it to our dict for easy lookup later
plugins[plugin.name()] = plugin;
if (!plugin.loadError) {
// add it to our dict for easy lookup later
plugins[plugin.name()] = plugin;
log.info("Loaded plugin: " + plugin.name());
log.info("Loaded plugin: " + plugin.name());
// call the plugin's initializer and pass it our API instance
plugin.initializer(this._api);
// call the plugin's initializer and pass it our API instance
plugin.initializer(this._api);
log.info("---");
log.info("---");
foundOnePlugin = true;
}
}.bind(this));
// Complain if you don't have any plugins.
if (!foundOnePlugin) {
log.warn("No plugins found. See the README for information on installing plugins.")
}
return plugins;
}
@@ -97,7 +107,7 @@ Server.prototype._loadConfig = function() {
// Complain and exit if it doesn't exist yet
if (!fs.existsSync(configPath)) {
log.error("Couldn't find a config.json file in the same directory as app.js. Look at config-sample.json for examples of how to format your config.js and add your home accessories.");
log.error("Couldn't find a config.json file at '"+configPath+"'. Look at config-sample.json for examples of how to format your config.js and add your home accessories.");
process.exit(1);
}