Commit 173f8e2e authored by Ismo Puustinen's avatar Ismo Puustinen

hack/lib/golang.sh: use double quotes.

It's admittedly extremely unlikely that the host platform name would contain special characters, but still use double quotes to pattern matching. Consider this script: #!/bin/bash bar="foobar" foo="foo*" [[ $bar == $foo ]] && echo "first true" [[ "$bar" == "$foo" ]] && echo "second true" We get the output: first true The plan is to move from first case to the second case to prevent pattern match where there shouldn't be any.
parent c0c888fd
...@@ -401,7 +401,7 @@ kube::golang::place_bins() { ...@@ -401,7 +401,7 @@ kube::golang::place_bins() {
# The substitution on platform_src below will replace all slashes with # The substitution on platform_src below will replace all slashes with
# underscores. It'll transform darwin/amd64 -> darwin_amd64. # underscores. It'll transform darwin/amd64 -> darwin_amd64.
local platform_src="/${platform//\//_}" local platform_src="/${platform//\//_}"
if [[ $platform == $host_platform ]]; then if [[ "$platform" == "$host_platform" ]]; then
platform_src="" platform_src=""
rm -f "${THIS_PLATFORM_BIN}" rm -f "${THIS_PLATFORM_BIN}"
ln -s "${KUBE_OUTPUT_BINPATH}/${platform}" "${THIS_PLATFORM_BIN}" ln -s "${KUBE_OUTPUT_BINPATH}/${platform}" "${THIS_PLATFORM_BIN}"
...@@ -465,7 +465,7 @@ kube::golang::output_filename_for_binary() { ...@@ -465,7 +465,7 @@ kube::golang::output_filename_for_binary() {
local binary=$1 local binary=$1
local platform=$2 local platform=$2
local output_path="${KUBE_GOPATH}/bin" local output_path="${KUBE_GOPATH}/bin"
if [[ $platform != $host_platform ]]; then if [[ "$platform" != "$host_platform" ]]; then
output_path="${output_path}/${platform//\//_}" output_path="${output_path}/${platform//\//_}"
fi fi
local bin=$(basename "${binary}") local bin=$(basename "${binary}")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment