Skip to content
This repository was archived by the owner on Feb 2, 2021. It is now read-only.

Commit 20888cf

Browse files
committed
update after review
1 parent a812f5a commit 20888cf

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

services/xcode-select-service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export class XcodeSelectService implements IXcodeSelectService {
3434
if (!xcodeVer) {
3535
this.$errors.fail("xcodebuild execution failed. Make sure that you have latest Xcode and tools installed.");
3636
}
37+
3738
let xcodeVersionMatch = xcodeVer.match(/Xcode (.*)/),
3839
xcodeVersionGroup = xcodeVersionMatch && xcodeVersionMatch[1],
3940
xcodeVersionSplit = xcodeVersionGroup && xcodeVersionGroup.split(".");

sys-info-base.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,13 @@ export class SysInfoBase implements ISysInfo {
5757
return this.javaCompilerVerCache;
5858
}
5959

60+
private xCodeVerCache: string = null;
6061
public async getXCodeVersion(): Promise<string> {
61-
return this.$hostInfo.isDarwin ? await this.exec("xcodebuild -version") : null;
62+
if (!this.xCodeVerCache) {
63+
this.xCodeVerCache = this.$hostInfo.isDarwin ? await this.exec("xcodebuild -version") : null;
64+
}
65+
66+
return this.xCodeVerCache;
6267
}
6368

6469
private nodeGypVerCache: string = null;
@@ -147,9 +152,9 @@ export class SysInfoBase implements ISysInfo {
147152
res.procArch = process.arch;
148153
res.nodeVer = process.version;
149154

150-
res.npmVer = await this.getNpmVersion(); //not used anywhere except for tests
155+
res.npmVer = await this.getNpmVersion();
151156

152-
res.javaVer = await this.getJavaVersion(); //not used anywhere except for tests
157+
res.javaVer = await this.getJavaVersion();
153158

154159
res.nodeGypVer = await this.getNodeGypVersion();
155160
res.xcodeVer = await this.getXCodeVersion();
@@ -197,7 +202,7 @@ export class SysInfoBase implements ISysInfo {
197202
}
198203
} catch (e) {
199204
// if we got an error, assume not working
200-
this.$logger.trace(`Error while executing child process: ${e}`);
205+
this.$logger.trace(`Error while executing ${cmd}: ${e.message}`);
201206
}
202207

203208
return null;

0 commit comments

Comments
 (0)