@@ -5,28 +5,25 @@ export class MigrateCommand implements ICommand {
5
5
private $devicePlatformsConstants : Mobile . IDevicePlatformsConstants ,
6
6
private $migrateController : IMigrateController ,
7
7
private $projectData : IProjectData ,
8
- private $errors : IErrors ) {
8
+ private $logger : ILogger ) {
9
9
this . $projectData . initializeProjectData ( ) ;
10
10
}
11
11
12
12
public async execute ( args : string [ ] ) : Promise < void > {
13
- await this . $migrateController . migrate ( {
14
- projectDir : this . $projectData . projectDir ,
15
- platforms : [ this . $devicePlatformsConstants . Android , this . $devicePlatformsConstants . iOS ]
16
- } ) ;
17
- }
18
-
19
- public async canExecute ( args : string [ ] ) : Promise < boolean > {
20
13
const shouldMigrateResult = await this . $migrateController . shouldMigrate ( {
21
14
projectDir : this . $projectData . projectDir ,
22
15
platforms : [ this . $devicePlatformsConstants . Android , this . $devicePlatformsConstants . iOS ]
23
16
} ) ;
24
17
25
18
if ( ! shouldMigrateResult ) {
26
- this . $errors . failWithoutHelp ( 'Project is compatible with NativeScript "v6.0.0". To get the latest NativesScript packages execute "tns update".' ) ;
19
+ this . $logger . printMarkdown ( '__Project is compatible with NativeScript "v6.0.0". To get the latest NativesScript packages execute "tns update".__' ) ;
20
+ return ;
27
21
}
28
22
29
- return true ;
23
+ await this . $migrateController . migrate ( {
24
+ projectDir : this . $projectData . projectDir ,
25
+ platforms : [ this . $devicePlatformsConstants . Android , this . $devicePlatformsConstants . iOS ]
26
+ } ) ;
30
27
}
31
28
}
32
29
0 commit comments