cnauroth opened a new pull request, #772:
URL: https://github.com/apache/ratis/pull/772
…ble with CDPATH.
## What changes were proposed in this pull request?
Several Bash scripts in Ratis use this common idiom to discover the current
source path and then build relative paths from it:
```
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
```
This mostly works well, but it isn't compatible with interactive shells
using the `CDPATH` environment variable to provide a custom search path for
resolving the directory referenced by `cd`. (See [bash man
page](https://linux.die.net/man/1/bash) discussion of `CDPATH` and how the
resolved directory is "written to the standard output.")
The standard solution is to redirect stdout of `cd` to `/dev/null`:
```
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"
```
Some Ratis scripts already do this, but not all.
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/RATIS-1340
## How was this patch tested?
Manual testing invoking the scripts.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]