Skip to content

Commit 8c295cd

Browse files
committed
Fix sql cli sourcing of x-pack-env (#52613)
The sql-cli script sources x-pack-env, but it does so assuming the current directory is ES_HOME. This commit alters the source command to use ES_HOME which is available after running elasticsearch-env. closes #47803
1 parent 7d9de84 commit 8c295cd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

x-pack/plugin/sql/src/main/bin/elasticsearch-sql-cli

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
source "`dirname "$0"`"/elasticsearch-env
88

9-
source "`dirname "$0"`"/x-pack-env
9+
source "$ES_HOME"/bin/x-pack-env
1010

11-
CLI_JAR=$(ls $ES_HOME/bin/elasticsearch-sql-cli-*.jar)
11+
CLI_JAR=$(ls "$ES_HOME"/bin/elasticsearch-sql-cli-*.jar)
1212

1313
exec \
1414
"$JAVA" \

x-pack/plugin/sql/src/main/bin/elasticsearch-sql-cli.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ setlocal enableextensions
99

1010
call "%~dp0elasticsearch-env.bat" || exit /b 1
1111

12-
call "%~dp0x-pack-env.bat" || exit /b 1
12+
call "%ES_HOME%/bin/x-pack-env.bat" || exit /b 1
1313

1414
set CLI_JAR=%ES_HOME%/bin/*
1515

0 commit comments

Comments
 (0)