Skip to content

Commit bca245a

Browse files
Fatme HavaluovaFatme Havaluova
Fatme Havaluova
authored and
Fatme Havaluova
committed
Remove the unneeded code from plugin.remove function and from android-project-service
1 parent aae1c98 commit bca245a

File tree

2 files changed

+3
-18
lines changed

2 files changed

+3
-18
lines changed

lib/services/android-project-service.ts

-4
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,6 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
152152
public interpolateConfigurationFile(): IFuture<void> {
153153
return (() => {
154154
let manifestPath = this.platformData.configurationFilePath;
155-
156-
console.log("ANDROID MANIFEST FILE PATH!!!!");
157-
console.log(manifestPath);
158-
159155
shell.sed('-i', /__PACKAGE__/, this.$projectData.projectId, manifestPath);
160156
shell.sed('-i', /__APILEVEL__/, this.$options.sdk || this.$androidToolsInfo.getToolsInfo().wait().compileSdkVersion.toString(), manifestPath);
161157
}).future<void>()();

lib/services/plugins-service.ts

+3-14
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,6 @@ export class PluginsService implements IPluginsService {
6666

6767
public remove(pluginName: string): IFuture<void> {
6868
return (() => {
69-
let isUninstallCommandExecuted = false;
70-
71-
let executeUninstallCommand = () => {
72-
return (() => {
73-
if(!isUninstallCommandExecuted) {
74-
this.executeNpmCommand(PluginsService.UNINSTALL_COMMAND_NAME, pluginName).wait();
75-
isUninstallCommandExecuted = true;
76-
}
77-
}).future<void>()();
78-
};
79-
8069
let removePluginNativeCodeAction = (modulesDestinationPath: string, platform: string, platformData: IPlatformData) => {
8170
return (() => {
8271
let pluginData = this.convertToPluginData(this.getNodeModuleData(pluginName).wait());
@@ -96,7 +85,7 @@ export class PluginsService implements IPluginsService {
9685
};
9786
this.executeForAllInstalledPlatforms(removePluginNativeCodeAction).wait();
9887

99-
executeUninstallCommand().wait();
88+
this.executeNpmCommand(PluginsService.UNINSTALL_COMMAND_NAME, pluginName).wait();
10089

10190
let showMessage = true;
10291
let action = (modulesDestinationPath: string, platform: string, platformData: IPlatformData) => {
@@ -119,10 +108,11 @@ export class PluginsService implements IPluginsService {
119108
return (() => {
120109
this.$projectDataService.initialize(this.$projectData.projectDir);
121110
let frameworkVersion = this.$projectDataService.getValue(platformData.frameworkPackageName).wait().version;
122-
this.$npm.cache(platformData.frameworkPackageName, frameworkVersion).wait();
123111

124112
// We need to resolve this manager here due to some restrictions from npm api and in order to load PluginsService.NPM_CONFIG config
125113
let npmInstallationManager: INpmInstallationManager = this.$injector.resolve("npmInstallationManager");
114+
npmInstallationManager.addToCache(platformData.frameworkPackageName, frameworkVersion).wait();
115+
126116
let cachedPackagePath = npmInstallationManager.getCachedPackagePath(platformData.frameworkPackageName, frameworkVersion);
127117
let cachedConfigurationFilePath = path.join(cachedPackagePath, constants.PROJECT_FRAMEWORK_FOLDER_NAME, platformData.relativeToFrameworkConfigurationFilePath);
128118
let cachedConfigurationFileContent = this.$fs.readText(cachedConfigurationFilePath).wait();
@@ -147,7 +137,6 @@ export class PluginsService implements IPluginsService {
147137
shelljs.cp("-Rf", pluginData.fullPath, pluginDestinationPath);
148138

149139
let pluginConfigurationFilePath = this.getPluginConfigurationFilePath(pluginData, platformData);
150-
151140
if(this.$fs.exists(pluginConfigurationFilePath).wait()) {
152141
this.merge(pluginData, platformData).wait();
153142
}

0 commit comments

Comments
 (0)