mirror of
https://github.com/mtan93/homebridge.git
synced 2026-03-08 05:31:55 +00:00
Move bugged peerDependencies -> engines
This commit is contained in:
@@ -6,7 +6,8 @@
|
|||||||
"keywords": [
|
"keywords": [
|
||||||
"homebridge-plugin"
|
"homebridge-plugin"
|
||||||
],
|
],
|
||||||
"peerDepdendencies": {
|
"engines": {
|
||||||
|
"node": ">=0.12.0",
|
||||||
"homebridge": ">=0.2.0"
|
"homebridge": ">=0.2.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -37,11 +37,11 @@ Plugin.prototype.load = function(options) {
|
|||||||
var pjson = Plugin.loadPackageJSON(this.pluginPath);
|
var pjson = Plugin.loadPackageJSON(this.pluginPath);
|
||||||
|
|
||||||
// pluck out the HomeBridge version requirement
|
// pluck out the HomeBridge version requirement
|
||||||
if (!pjson.peerDepdendencies || !pjson.peerDepdendencies.homebridge) {
|
if (!pjson.engines || !pjson.engines.homebridge) {
|
||||||
throw new Error("Plugin " + this.pluginPath + " does not contain the 'homebridge' package in 'peerDepdendencies'.");
|
throw new Error("Plugin " + this.pluginPath + " does not contain the 'homebridge' package in 'engines'.");
|
||||||
}
|
}
|
||||||
|
|
||||||
var versionRequired = pjson.peerDepdendencies.homebridge;
|
var versionRequired = pjson.engines.homebridge;
|
||||||
|
|
||||||
// make sure the version is satisfied by the currently running version of HomeBridge
|
// make sure the version is satisfied by the currently running version of HomeBridge
|
||||||
if (!semver.satisfies(version, versionRequired)) {
|
if (!semver.satisfies(version, versionRequired)) {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
"homebridge": "bin/homebridge"
|
"homebridge": "bin/homebridge"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 0.12.0"
|
"node": ">=0.12.0"
|
||||||
},
|
},
|
||||||
"preferGlobal": true,
|
"preferGlobal": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
Reference in New Issue
Block a user