Skip to content

Commit 0ca2d0e

Browse files
Fix transpilation
`@types/temp` depends on `"@types/node": "*"`, so a new version of the `node.d.ts` is installed. This breaks our code. Fix the code, but we'll have to figure it out how to make sure it won't happen again.
1 parent 5fccd04 commit 0ca2d0e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/sys-info.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class SysInfo implements NativeScriptDoctor.ISysInfo {
6868
public getJavaCompilerVersion(): Promise<string> {
6969
return this.getValueForProperty(() => this.javaCompilerVerCache, async (): Promise<string> => {
7070
const javaCompileExecutableName = "javac";
71-
const javaHome = process.env.JAVA_HOME;
71+
const javaHome = process.env["JAVA_HOME"];
7272
const pathToJavaCompilerExecutable = javaHome ? path.join(javaHome, "bin", javaCompileExecutableName) : javaCompileExecutableName;
7373
try {
7474
const output = await this.childProcess.exec(`"${pathToJavaCompilerExecutable}" -version`);
@@ -135,7 +135,7 @@ export class SysInfo implements NativeScriptDoctor.ISysInfo {
135135
let mobileDeviceDir: string;
136136

137137
if (this.hostInfo.isWindows) {
138-
const commonProgramFiles = this.hostInfo.isWindows64 ? process.env["CommonProgramFiles(x86)"] : process.env.CommonProgramFiles;
138+
const commonProgramFiles = this.hostInfo.isWindows64 ? process.env["CommonProgramFiles(x86)"] : process.env["CommonProgramFiles"];
139139
coreFoundationDir = path.join(commonProgramFiles, "Apple", "Apple Application Support");
140140
mobileDeviceDir = path.join(commonProgramFiles, "Apple", "Mobile Device Support");
141141
} else if (this.hostInfo.isDarwin) {

test/sys-info.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ describe("SysInfo unit tests", () => {
153153

154154
beforeEach(() => {
155155
// We need to mock this because on Mac the tests in which the platform is mocked to Windows in the process there will be no CommonProgramFiles.
156-
process.env.CommonProgramFiles = process.env.CommonProgramFiles || "mocked on mac";
156+
process.env["CommonProgramFiles"] = process.env["CommonProgramFiles"] || "mocked on mac";
157157
process.env["CommonProgramFiles(x86)"] = process.env["CommonProgramFiles(x86)"] || "mocked on mac";
158158
});
159159

0 commit comments

Comments
 (0)