@@ -114,18 +114,11 @@ export class PlatformService implements IPlatformService {
114114 let coreModuleData = this . $fs . readJson ( path . join ( frameworkDir , "../" , "package.json" ) ) . wait ( ) ;
115115 let installedVersion = coreModuleData . version ;
116116 let coreModuleName = coreModuleData . name ;
117- let isFrameworkPathDirectory = false ;
118117
119- if ( this . $options . frameworkPath ) {
120- let frameworkPathStats = this . $fs . getFsStats ( this . $options . frameworkPath ) . wait ( ) ;
121- isFrameworkPathDirectory = frameworkPathStats . isDirectory ( ) ;
122- }
123-
124- let sourceFrameworkDir = isFrameworkPathDirectory && this . $options . symlink ? path . join ( this . $options . frameworkPath , "framework" ) : frameworkDir ;
125118 this . $projectDataService . initialize ( this . $projectData . projectDir ) ;
126119 let customTemplateOptions = this . getPathToPlatformTemplate ( this . $options . platformTemplate , platformData . frameworkPackageName ) . wait ( ) ;
127120 let pathToTemplate = customTemplateOptions && customTemplateOptions . pathToTemplate ;
128- platformData . platformProjectService . createProject ( path . resolve ( sourceFrameworkDir ) , installedVersion , pathToTemplate ) . wait ( ) ;
121+ platformData . platformProjectService . createProject ( path . resolve ( frameworkDir ) , installedVersion , pathToTemplate ) . wait ( ) ;
129122 platformData . platformProjectService . ensureConfigurationFileInAppResources ( ) . wait ( ) ;
130123 platformData . platformProjectService . interpolateData ( ) . wait ( ) ;
131124 platformData . platformProjectService . afterCreateProject ( platformData . projectRoot ) . wait ( ) ;
@@ -692,12 +685,13 @@ export class PlatformService implements IPlatformService {
692685
693686 let newVersion = version === constants . PackageVersion . NEXT ?
694687 this . $npmInstallationManager . getNextVersion ( platformData . frameworkPackageName ) . wait ( ) :
695- this . $npmInstallationManager . getLatestVersion ( platformData . frameworkPackageName ) . wait ( ) ;
696- let installedModuleDir = this . $npmInstallationManager . install ( platformData . frameworkPackageName , this . $projectData . projectDir , { version : newVersion } ) . wait ( ) ;
688+ version || this . $npmInstallationManager . getLatestCompatibleVersion ( platformData . frameworkPackageName ) . wait ( ) ;
689+ let installedModuleDir = this . $npmInstallationManager . install ( platformData . frameworkPackageName , this . $projectData . projectDir , { version : newVersion , dependencyType : "save" } ) . wait ( ) ;
697690 let cachedPackageData = this . $fs . readJson ( path . join ( installedModuleDir , "package.json" ) ) . wait ( ) ;
698691 newVersion = ( cachedPackageData && cachedPackageData . version ) || newVersion ;
699692
700693 let canUpdate = platformData . platformProjectService . canUpdatePlatform ( installedModuleDir ) . wait ( ) ;
694+ this . $npm . uninstall ( platformData . frameworkPackageName , { save : true } , this . $projectData . projectDir ) . wait ( ) ;
701695 if ( canUpdate ) {
702696 if ( ! semver . valid ( newVersion ) ) {
703697 this . $errors . fail ( "The version %s is not valid. The version should consists from 3 parts separated by dot." , newVersion ) ;
@@ -723,6 +717,7 @@ export class PlatformService implements IPlatformService {
723717 this . removePlatforms ( [ packageName ] ) . wait ( ) ;
724718 packageName = newVersion ? `${ packageName } @${ newVersion } ` : packageName ;
725719 this . addPlatform ( packageName ) . wait ( ) ;
720+ this . $logger . out ( "Successfully updated to version " , newVersion ) ;
726721 } ) . future < void > ( ) ( ) ;
727722 }
728723
0 commit comments