Skip to content

Commit 986a9fe

Browse files
committed
A plugin with android only code in platforms installs aar-s in iOS platform
1 parent 517aef4 commit 986a9fe

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/services/plugins-service.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,15 @@ export class PluginsService implements IPluginsService {
115115
let pluginDestinationPath = path.join(platformData.appDestinationDirectoryPath, constants.APP_FOLDER_NAME, "tns_modules");
116116
let pluginData = this.convertToPluginData(dependencyData);
117117

118+
let exists = this.$fs.exists(path.join(platformData.appDestinationDirectoryPath, constants.APP_FOLDER_NAME)).wait();
119+
118120
if (!this.isPluginDataValidForPlatform(pluginData, platform).wait()) {
121+
// Still clean up platform in case other platforms were supported.
122+
shelljs.rm("-rf", path.join(pluginDestinationPath, pluginData.name, "platforms"));
119123
return;
120124
}
121125

122-
if (this.$fs.exists(path.join(platformData.appDestinationDirectoryPath, constants.APP_FOLDER_NAME)).wait()) {
126+
if (exists) {
123127
this.$fs.ensureDirectoryExists(pluginDestinationPath).wait();
124128
shelljs.cp("-Rf", pluginData.fullPath, pluginDestinationPath);
125129

0 commit comments

Comments
 (0)