Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion distribution/src/bin/elasticsearch-cli
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ source "`dirname "$0"`"/elasticsearch-env
IFS=';' read -r -a additional_sources <<< "$ES_ADDITIONAL_SOURCES"
for additional_source in "${additional_sources[@]}"
do
source "`dirname "$0"`"/$additional_source
source $ES_HOME/bin/$additional_source
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably need quotes here since ES_HOME could have spaces. Can you verify this, and quote if needed.

Also, does Windows have the same problem and need a fix too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, does Windows have the same problem and need a fix too?

we use:

if defined ES_ADDITIONAL_SOURCES (
  for %%a in ("%ES_ADDITIONAL_SOURCES:;=","%") do (
    call "%~dp0%%a"
  )
)

%~dp0 will always expand to the full path where the batch file is located and not one relative to where the batch script is executed from, so it will not be affected by the cd that happens when we source elasticsearch-env.bat . That said, I'd have nothing against a manual confirmation, I don't have access to a windows machine right now :/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks right to me, thanks for checking.

done

IFS=';' read -r -a additional_classpath_directories <<< "$ES_ADDITIONAL_CLASSPATH_DIRECTORIES"
Expand Down