-
-
Notifications
You must be signed in to change notification settings - Fork 197
/
Copy pathmigrate.ts
30 lines (25 loc) · 1.05 KB
/
migrate.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
export class MigrateCommand implements ICommand {
public allowedParameters: ICommandParameter[] = [];
constructor(
private $devicePlatformsConstants: Mobile.IDevicePlatformsConstants,
private $migrateController: IMigrateController,
private $projectData: IProjectData,
private $logger: ILogger) {
this.$projectData.initializeProjectData();
}
public async execute(args: string[]): Promise<void> {
const shouldMigrateResult = await this.$migrateController.shouldMigrate({
projectDir: this.$projectData.projectDir,
platforms: [this.$devicePlatformsConstants.Android, this.$devicePlatformsConstants.iOS]
});
if (!shouldMigrateResult) {
this.$logger.printMarkdown('__Project is compatible with NativeScript "v6.0.0". To get the latest NativesScript packages execute "tns update".__');
return;
}
await this.$migrateController.migrate({
projectDir: this.$projectData.projectDir,
platforms: [this.$devicePlatformsConstants.Android, this.$devicePlatformsConstants.iOS]
});
}
}
$injector.registerCommand("migrate", MigrateCommand);