Skip to content

docs: improve the platform add logging by listing the installed runtime version #3778

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 31, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions lib/services/platform-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export class PlatformService extends EventEmitter implements IPlatformService {

const spinner = this.$terminalSpinnerService.createSpinner();
const platformPath = path.join(projectData.platformsDir, platform);
let installedPlatformVersion;

try {
spinner.start();
Expand All @@ -128,7 +129,8 @@ export class PlatformService extends EventEmitter implements IPlatformService {
await this.$pacoteService.extractPackage(packageToInstall, downloadedPackagePath);
let frameworkDir = path.join(downloadedPackagePath, constants.PROJECT_FRAMEWORK_FOLDER_NAME);
frameworkDir = path.resolve(frameworkDir);
await this.addPlatformCore(platformData, frameworkDir, platformTemplate, projectData, config, nativePrepare);
installedPlatformVersion =
await this.addPlatformCore(platformData, frameworkDir, platformTemplate, projectData, config, nativePrepare);
} catch (err) {
this.$fs.deleteDirectory(platformPath);
throw err;
Expand All @@ -137,7 +139,7 @@ export class PlatformService extends EventEmitter implements IPlatformService {
}

this.$fs.ensureDirectoryExists(platformPath);
this.$logger.out(`Platform ${platform} successfully added.`);
this.$logger.out(`Platform ${platform} successfully added. v${installedPlatformVersion}`);
}

private async addPlatformCore(platformData: IPlatformData, frameworkDir: string, platformTemplate: string, projectData: IProjectData, config: IPlatformOptions, nativePrepare?: INativePrepare): Promise<string> {
Expand Down Expand Up @@ -165,8 +167,7 @@ export class PlatformService extends EventEmitter implements IPlatformService {
});
}

const coreModuleName = coreModuleData.name;
return coreModuleName;
return installedVersion;
}

public getInstalledPlatforms(projectData: IProjectData): string[] {
Expand Down