Skip to content

Commit

Permalink
Fix sql cli sourcing of x-pack-env (#52613)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rjernst committed Feb 24, 2020
1 parent 7d9de84 commit 8c295cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions x-pack/plugin/sql/src/main/bin/elasticsearch-sql-cli
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

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

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

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

exec \
"$JAVA" \
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugin/sql/src/main/bin/elasticsearch-sql-cli.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ setlocal enableextensions

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

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

set CLI_JAR=%ES_HOME%/bin/*

Expand Down

0 comments on commit 8c295cd

Please sign in to comment.