Skip to content

Commit 2e5ca3c

Browse files
author
Dimitar Tachev
authored
Merge pull request #4609 from NativeScript/tgpetrov-patch-1
style: misleading warning message
2 parents f9424dc + 6ddcc2f commit 2e5ca3c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/services/plugins-service.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -318,12 +318,12 @@ export class PluginsService implements IPluginsService {
318318
const installedFrameworkVersion = this.getInstalledFrameworkVersion(platform, projectData);
319319
const pluginPlatformsData = pluginData.platformsData;
320320
if (pluginPlatformsData) {
321-
const pluginVersion = (<any>pluginPlatformsData)[platform];
322-
if (!pluginVersion) {
321+
const versionRequiredByPlugin = (<any>pluginPlatformsData)[platform];
322+
if (!versionRequiredByPlugin) {
323323
this.$logger.warn(`${pluginData.name} is not supported for ${platform}.`);
324324
isValid = false;
325-
} else if (semver.gt(pluginVersion, installedFrameworkVersion)) {
326-
this.$logger.warn(`${pluginData.name} ${pluginVersion} for ${platform} is not compatible with the currently installed framework version ${installedFrameworkVersion}.`);
325+
} else if (semver.gt(versionRequiredByPlugin, installedFrameworkVersion)) {
326+
this.$logger.warn(`${pluginData.name} requires at least version ${versionRequiredByPlugin} of platform ${platform}. Currently installed version is ${installedFrameworkVersion}.`);
327327
isValid = false;
328328
}
329329
}

test/plugins-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ describe("Plugins service", () => {
272272
});
273273
it("fails when the plugin does not support the installed framework", async () => {
274274
let isWarningMessageShown = false;
275-
const expectedWarningMessage = "mySamplePlugin 1.5.0 for android is not compatible with the currently installed framework version 1.4.0.";
275+
const expectedWarningMessage = "mySamplePlugin requires at least version 1.5.0 of platform android. Currently installed version is 1.4.0.";
276276

277277
// Creates plugin in temp folder
278278
const pluginName = "mySamplePlugin";

0 commit comments

Comments
 (0)