From 8c295cdc8789b199eaa6d8d8f293c1521b463463 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Mon, 24 Feb 2020 11:13:06 -0800 Subject: [PATCH] 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 --- x-pack/plugin/sql/src/main/bin/elasticsearch-sql-cli | 4 ++-- x-pack/plugin/sql/src/main/bin/elasticsearch-sql-cli.bat | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/x-pack/plugin/sql/src/main/bin/elasticsearch-sql-cli b/x-pack/plugin/sql/src/main/bin/elasticsearch-sql-cli index 676b842beed..47916a7975e 100755 --- a/x-pack/plugin/sql/src/main/bin/elasticsearch-sql-cli +++ b/x-pack/plugin/sql/src/main/bin/elasticsearch-sql-cli @@ -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" \ diff --git a/x-pack/plugin/sql/src/main/bin/elasticsearch-sql-cli.bat b/x-pack/plugin/sql/src/main/bin/elasticsearch-sql-cli.bat index 48daf97b515..e9812981517 100644 --- a/x-pack/plugin/sql/src/main/bin/elasticsearch-sql-cli.bat +++ b/x-pack/plugin/sql/src/main/bin/elasticsearch-sql-cli.bat @@ -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/*