Ensure that dev-env is in PATH for other dev-env tools (#2127)

This is relevant for users of the IntelliJ bazel plugin. It is common to
start IntelliJ via the GUI such that the dev-env is not loaded for
IntelliJ. The bazel plugin is then configured to execute the dev-env
bazel by entering the path into the corresponding configuration option.
However, this bazel is then executed without the dev-env tools in PATH.
Some of the repository rules expect certain dev-env tools in PATH, e.g.
python3. Those will then fail.

This patch ensures that the dev-env is loaded when executing dev-env
tools from outside the dev-env.
This commit is contained in:
Andreas Herrmann 2019-07-15 15:29:00 +02:00 committed by GitHub
parent f57e437b80
commit f64b63f7a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -127,6 +127,8 @@ execTool() {
local outputName=$2
local binary=$3
shift 3
[[ $PATH =~ (^|.*:)$DADE_DEVENV_DIR/bin($|:.*) ]] || \
eval "$(${DADE_DEVENV_DIR}/bin/dade assist)"
buildTool $attr $outputName 0
exec "$(readlink "$DADE_BUILD_RESULT")/bin/$binary" "$@"
}