Skip to content

Incorrect source in elasticsearch-sql-cli #47803

@alpar-t

Description

@alpar-t

One can't start the tool from any working directory.

Here's a reproduction

# create a test cluster
./gradlew run
cd distribution/build/testclusters/runTask-0
ES_CONFIG_PATH=$PWD/config ./distro/8.0.0-DEFAULT/bin/elasticsearch-sql-cli
# Fails with : ./distro/8.0.0-DEFAULT/bin/elasticsearch-sql-cli: line 9: ./distro/8.0.0-DEFAULT/bin/x-pack-env: No such file or directory
cd distro/8.0.0-DEFAULT
ES_CONFIG_PATH=$PWD/../../config ./bin/elasticsearch-sql-cli
# works

The reason for this is that source "dirname "$0""/elasticsearch-env changes the working directory to $ES_HOME so I think the second source should just be

source ./bin/x-pack-env

Would be nice to add some packaging tests to qa/os to make sure the tool can be called from different places.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions