Skip to content

Commit

Permalink
make init-es.sh work outside bash
Browse files Browse the repository at this point in the history
Many Docker images are built on lightweight linux distros that don't
include bash. The eclipse-temurin image that provides a JDK is one
example. To run a script like this on that kind of image, it can't use
any exclusive bash-isms. The script just has one, small issue: it uses
the `BASH_SOURCE` env variable. An almost identical replacement for
`${BASH_SOURCE[0]}` is `$0`, and it should work fine for us. For
further details see https://stackoverflow.com/a/35006505.
  • Loading branch information
zzantozz committed Jul 26, 2022
1 parent fe5b71f commit 1d6f4ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion blueflood-elasticsearch/src/main/resources/init-es.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if [ $ES_USERNAME ] && [ $ES_PASSWD ]; then
fi

# Using this in the checkfile function allows us to run this script from any directory
ABSOLUTE_PATH=$(cd `dirname "${BASH_SOURCE[0]}"` && pwd)
ABSOLUTE_PATH=$(cd `dirname "$0"` && pwd)
function checkFile
{
echo checking $1.
Expand Down

0 comments on commit 1d6f4ff

Please sign in to comment.