Skip to content

Commit 32ab108

Browse files
committed
Move interesting JRE properties out of checkJdkSettings
1 parent 9715925 commit 32ab108

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

lib/start-proxy-action.js

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/start-proxy/environment.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ function checkEnvVar(logger: Logger, name: string): boolean {
3030
}
3131
}
3232

33+
// The JRE properties that may affect the proxy.
34+
const javaProperties = [
35+
"http.proxyHost",
36+
"http.proxyPort",
37+
"https.proxyHost",
38+
"https.proxyPort",
39+
"http.nonProxyHosts",
40+
"java.net.useSystemProxies",
41+
];
42+
3343
/** Java-specific environment variables which may contain information about proxy settings. */
3444
export const JAVA_PROXY_ENV_VARS: JavaEnvVars[] = [
3545
JavaEnvVars.JAVA_TOOL_OPTIONS,
@@ -83,16 +93,6 @@ export function checkJdkSettings(logger: Logger, jdkHome: string) {
8393
path.join("lib", "net.properties"),
8494
];
8595

86-
// The JRE properties that may affect the proxy.
87-
const properties = [
88-
"http.proxyHost",
89-
"http.proxyPort",
90-
"https.proxyHost",
91-
"https.proxyPort",
92-
"http.nonProxyHosts",
93-
"java.net.useSystemProxies",
94-
];
95-
9696
for (const fileToCheck of filesToCheck) {
9797
const file = path.join(jdkHome, fileToCheck);
9898

@@ -102,7 +102,7 @@ export function checkJdkSettings(logger: Logger, jdkHome: string) {
102102

103103
const lines = String(fs.readFileSync(file)).split("\n");
104104
for (const line of lines) {
105-
for (const property of properties) {
105+
for (const property of javaProperties) {
106106
if (line.startsWith(`${property}=`)) {
107107
logger.info(`Found '${line.trimEnd()}' in '${file}'.`);
108108
}

0 commit comments

Comments
 (0)