Skip to content

Commit cccf3d5

Browse files
committed
Fixed warning
1 parent 6a07925 commit cccf3d5

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ jobs:
66
strategy:
77
fail-fast: false
88
matrix:
9-
os: [ubuntu-24.04, ubuntu-24.04-arm, ubuntu-22.04, ubuntu-22.04-arm, macos-26, macos-15, macos-15-intel, macos-14, macos-13, windows-2025, windows-2022]
10-
elasticsearch-version: [9, 8]
9+
os: [ubuntu-24.04]
10+
elasticsearch-version: [9]
1111
steps:
1212
- uses: actions/checkout@v5
1313
- uses: ./.

index.js

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,15 @@ const versionMap = {
3232
'8.0': '8.0.1'
3333
};
3434

35+
const env = Object.assign({}, process.env);
36+
delete env.JAVA_HOME;
37+
3538
function run() {
3639
const args = Array.from(arguments);
3740
console.log(args.join(' '));
3841
const command = args.shift();
3942
// spawn is safer and more lightweight than exec
40-
const ret = spawnSync(command, args, {stdio: 'inherit'});
43+
const ret = spawnSync(command, args, {stdio: 'inherit', env: env});
4144
if (ret.status !== 0) {
4245
throw ret.error;
4346
}
@@ -52,7 +55,7 @@ function runBat() {
5255
if (!fs.existsSync(command)) {
5356
throw 'Bat not found';
5457
}
55-
const ret = spawnSync(command, args, {stdio: 'inherit', shell: true});
58+
const ret = spawnSync(command, args, {stdio: 'inherit', env: env, shell: true});
5659
if (ret.status !== 0) {
5760
throw ret.error;
5861
}
@@ -198,15 +201,6 @@ const elasticsearchVersion = getVersion();
198201
const cacheDir = path.join(os.homedir(), 'elasticsearch');
199202
const esHome = path.join(cacheDir, elasticsearchVersion);
200203

201-
// java compatibility
202-
// https://www.elastic.co/support/matrix
203-
const majorVersion = parseInt(elasticsearchVersion.split('.')[0]);
204-
const javaHome = majorVersion == 8 ? process.env.JAVA_HOME_17_X64 : process.env.JAVA_HOME_21_X64;
205-
if (javaHome) {
206-
process.env.ES_JAVA_HOME = javaHome;
207-
addToEnv(`ES_JAVA_HOME=${javaHome}`);
208-
}
209-
210204
if (!fs.existsSync(esHome)) {
211205
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'elasticsearch-'));
212206
process.chdir(tmpDir);

0 commit comments

Comments
 (0)