Skip to content

Commit

Permalink
fix: Check gradle executable and proxy settings (#1430)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdneo authored Oct 12, 2023
1 parent 3fb7c72 commit c6ca122
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions extension/src/bs/BuildServerController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,38 @@ export class BuildServerController implements Disposable {
}
})
);
this.checkGradleExecutable();
this.checkProxy();
}

public dispose() {
this.disposable.dispose();
}

private checkGradleExecutable(): void {
if (process.env.PATH) {
const pathDirectories = process.env.PATH.split(path.delimiter);
for (const dir of pathDirectories) {
const executablePath = path.join(dir, "gradle");
if (fse.existsSync(executablePath) && fse.statSync(executablePath).isFile()) {
sendInfo("", {
kind: "hasGradleExecutableInPath",
data: "true",
});
return;
}
}
}
}

private checkProxy(): void {
const proxy =
process.env.HTTP_PROXY ?? process.env.HTTPS_PROXY ?? workspace.getConfiguration("http").get("proxy");
if (proxy) {
sendInfo("", {
kind: "hasProxy",
data: "true",
});
}
}
}

0 comments on commit c6ca122

Please sign in to comment.