@@ -66,17 +66,6 @@ export class PluginsService implements IPluginsService {
66
66
67
67
public remove ( pluginName : string ) : IFuture < void > {
68
68
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
-
80
69
let removePluginNativeCodeAction = ( modulesDestinationPath : string , platform : string , platformData : IPlatformData ) => {
81
70
return ( ( ) => {
82
71
let pluginData = this . convertToPluginData ( this . getNodeModuleData ( pluginName ) . wait ( ) ) ;
@@ -96,7 +85,7 @@ export class PluginsService implements IPluginsService {
96
85
} ;
97
86
this . executeForAllInstalledPlatforms ( removePluginNativeCodeAction ) . wait ( ) ;
98
87
99
- executeUninstallCommand ( ) . wait ( ) ;
88
+ this . executeNpmCommand ( PluginsService . UNINSTALL_COMMAND_NAME , pluginName ) . wait ( ) ;
100
89
101
90
let showMessage = true ;
102
91
let action = ( modulesDestinationPath : string , platform : string , platformData : IPlatformData ) => {
@@ -119,10 +108,11 @@ export class PluginsService implements IPluginsService {
119
108
return ( ( ) => {
120
109
this . $projectDataService . initialize ( this . $projectData . projectDir ) ;
121
110
let frameworkVersion = this . $projectDataService . getValue ( platformData . frameworkPackageName ) . wait ( ) . version ;
122
- this . $npm . cache ( platformData . frameworkPackageName , frameworkVersion ) . wait ( ) ;
123
111
124
112
// We need to resolve this manager here due to some restrictions from npm api and in order to load PluginsService.NPM_CONFIG config
125
113
let npmInstallationManager : INpmInstallationManager = this . $injector . resolve ( "npmInstallationManager" ) ;
114
+ npmInstallationManager . addToCache ( platformData . frameworkPackageName , frameworkVersion ) . wait ( ) ;
115
+
126
116
let cachedPackagePath = npmInstallationManager . getCachedPackagePath ( platformData . frameworkPackageName , frameworkVersion ) ;
127
117
let cachedConfigurationFilePath = path . join ( cachedPackagePath , constants . PROJECT_FRAMEWORK_FOLDER_NAME , platformData . relativeToFrameworkConfigurationFilePath ) ;
128
118
let cachedConfigurationFileContent = this . $fs . readText ( cachedConfigurationFilePath ) . wait ( ) ;
@@ -147,7 +137,6 @@ export class PluginsService implements IPluginsService {
147
137
shelljs . cp ( "-Rf" , pluginData . fullPath , pluginDestinationPath ) ;
148
138
149
139
let pluginConfigurationFilePath = this . getPluginConfigurationFilePath ( pluginData , platformData ) ;
150
-
151
140
if ( this . $fs . exists ( pluginConfigurationFilePath ) . wait ( ) ) {
152
141
this . merge ( pluginData , platformData ) . wait ( ) ;
153
142
}
0 commit comments