@@ -114,18 +114,11 @@ export class PlatformService implements IPlatformService {
114
114
let coreModuleData = this . $fs . readJson ( path . join ( frameworkDir , "../" , "package.json" ) ) . wait ( ) ;
115
115
let installedVersion = coreModuleData . version ;
116
116
let coreModuleName = coreModuleData . name ;
117
- let isFrameworkPathDirectory = false ;
118
117
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 ;
125
118
this . $projectDataService . initialize ( this . $projectData . projectDir ) ;
126
119
let customTemplateOptions = this . getPathToPlatformTemplate ( this . $options . platformTemplate , platformData . frameworkPackageName ) . wait ( ) ;
127
120
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 ( ) ;
129
122
platformData . platformProjectService . ensureConfigurationFileInAppResources ( ) . wait ( ) ;
130
123
platformData . platformProjectService . interpolateData ( ) . wait ( ) ;
131
124
platformData . platformProjectService . afterCreateProject ( platformData . projectRoot ) . wait ( ) ;
@@ -692,12 +685,13 @@ export class PlatformService implements IPlatformService {
692
685
693
686
let newVersion = version === constants . PackageVersion . NEXT ?
694
687
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 ( ) ;
697
690
let cachedPackageData = this . $fs . readJson ( path . join ( installedModuleDir , "package.json" ) ) . wait ( ) ;
698
691
newVersion = ( cachedPackageData && cachedPackageData . version ) || newVersion ;
699
692
700
693
let canUpdate = platformData . platformProjectService . canUpdatePlatform ( installedModuleDir ) . wait ( ) ;
694
+ this . $npm . uninstall ( platformData . frameworkPackageName , { save : true } , this . $projectData . projectDir ) . wait ( ) ;
701
695
if ( canUpdate ) {
702
696
if ( ! semver . valid ( newVersion ) ) {
703
697
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 {
723
717
this . removePlatforms ( [ packageName ] ) . wait ( ) ;
724
718
packageName = newVersion ? `${ packageName } @${ newVersion } ` : packageName ;
725
719
this . addPlatform ( packageName ) . wait ( ) ;
720
+ this . $logger . out ( "Successfully updated to version " , newVersion ) ;
726
721
} ) . future < void > ( ) ( ) ;
727
722
}
728
723
0 commit comments