mirror of
https://github.com/mtan93/homebridge.git
synced 2026-03-08 05:31:55 +00:00
First pass at README update.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user