diff options
Diffstat (limited to 'lib/plugins/validatePlugin.js')
-rw-r--r-- | lib/plugins/validatePlugin.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/plugins/validatePlugin.js b/lib/plugins/validatePlugin.js index 37f6900..4baa911 100644 --- a/lib/plugins/validatePlugin.js +++ b/lib/plugins/validatePlugin.js @@ -14,20 +14,21 @@ function validatePlugin(plugin) { var isValid = ( plugin.isLoaded() && packageInfos && - packageInfos.name && - packageInfos.engines && - packageInfos.engines.gitbook + packageInfos.get('name') && + packageInfos.get('engines') && + packageInfos.get('engines').get('gitbook') ); if (!isValid) { return Promise.reject(new Error('Error loading plugin "' + plugin.getName() + '" at "' + plugin.getPath() + '"')); } - if (!gitbook.satisfies(this.packageInfos.engines.gitbook)) { - return Promise.reject(new Error('GitBook doesn\'t satisfy the requirements of this plugin: ' + packageInfos.engines.gitbook)); + var engine = packageInfos.get('engines').get('gitbook'); + if (!gitbook.satisfies(engine)) { + return Promise.reject(new Error('GitBook doesn\'t satisfy the requirements of this plugin: ' + engine)); } - return Promise(); + return Promise(plugin); } module.exports = validatePlugin; |