Skip to content

Commit 3ddf28f

Browse files
committedMar 13, 2017
Don't try to use go env if go is not installed
When someone is running our scripts without `go` installed, they will not be able to take advantage of the `$OS_OUTPUT_BINPATH` prefix for the `$PATH` by default, as we will not be able to determine where the built binaries would go. Signed-off-by: Steve Kuznetsov <[email protected]>
1 parent 39bc960 commit 3ddf28f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

Diff for: ‎hack/lib/util/environment.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,14 @@ readonly -f os::util::environment::setup_all_server_vars
107107
# - export PATH
108108
function os::util::environment::update_path_var() {
109109
local prefix
110-
prefix="${OS_OUTPUT_BINPATH}/$(os::util::host_platform):"
110+
if os::util::find::system_binary 'go' >/dev/null 2>&1; then
111+
prefix+="${OS_OUTPUT_BINPATH}/$(os::util::host_platform):"
112+
fi
111113
if [[ -n "${GOPATH:-}" ]]; then
112114
prefix+="${GOPATH}/bin:"
113115
fi
114116

115-
PATH="${prefix}:${PATH}"
117+
PATH="${prefix}${PATH}"
116118
export PATH
117119
}
118120
readonly -f os::util::environment::update_path_var

0 commit comments

Comments
 (0)
Please sign in to comment.