From 093f1580194856823dd16fa09d2a425fe61a928e Mon Sep 17 00:00:00 2001 From: Fatme Havaluova Date: Fri, 4 Sep 2015 10:40:40 +0300 Subject: [PATCH] Show correct warning if the plugin does not support the currently installed platform. --- lib/services/plugins-service.ts | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/lib/services/plugins-service.ts b/lib/services/plugins-service.ts index 0350486aac..f82df094a6 100644 --- a/lib/services/plugins-service.ts +++ b/lib/services/plugins-service.ts @@ -74,22 +74,23 @@ export class PluginsService implements IPluginsService { let action = (pluginDestinationPath: string, platform: string, platformData: IPlatformData) => { return (() => { - if(this.$fs.exists(path.join(platformData.appDestinationDirectoryPath, constants.APP_FOLDER_NAME)).wait()) { - // Process .js files - let installedFrameworkVersion = this.getInstalledFrameworkVersion(platform).wait(); - let pluginPlatformsData = pluginData.platformsData; - if(pluginPlatformsData) { - let pluginVersion = (pluginPlatformsData)[platform]; - if(!pluginVersion) { - this.$logger.warn(`${pluginData.name} is not supported for ${platform}.`); - return; - } - - if(semver.gt(pluginVersion, installedFrameworkVersion)) { - this.$logger.warn(`${pluginData.name} ${pluginVersion} for ${platform} is not compatible with the currently installed framework version ${installedFrameworkVersion}.`); - return; - } + // Process .js files + let installedFrameworkVersion = this.getInstalledFrameworkVersion(platform).wait(); + let pluginPlatformsData = pluginData.platformsData; + if(pluginPlatformsData) { + let pluginVersion = (pluginPlatformsData)[platform]; + if(!pluginVersion) { + this.$logger.warn(`${pluginData.name} is not supported for ${platform}.`); + return; + } + + if(semver.gt(pluginVersion, installedFrameworkVersion)) { + this.$logger.warn(`${pluginData.name} ${pluginVersion} for ${platform} is not compatible with the currently installed framework version ${installedFrameworkVersion}.`); + return; } + } + + if(this.$fs.exists(path.join(platformData.appDestinationDirectoryPath, constants.APP_FOLDER_NAME)).wait()) { this.$fs.ensureDirectoryExists(pluginDestinationPath).wait(); shelljs.cp("-Rf", pluginData.fullPath, pluginDestinationPath);