mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 20:53:33 +00:00
Merge pull request #90617 from CecileRobertMichon/find-bsd-util
Update find-binary-for-platform to work with non-GNU versions of find
This commit is contained in:
commit
b15c38e343
@ -208,6 +208,11 @@ kube::util::find-binary-for-platform() {
|
|||||||
locations+=("$location");
|
locations+=("$location");
|
||||||
done < <(find "${KUBE_ROOT}/bazel-bin/" -type f -executable \
|
done < <(find "${KUBE_ROOT}/bazel-bin/" -type f -executable \
|
||||||
\( -path "*/${platform/\//_}*/${lookfor}" -o -path "*/${lookfor}" \) 2>/dev/null || true)
|
\( -path "*/${platform/\//_}*/${lookfor}" -o -path "*/${lookfor}" \) 2>/dev/null || true)
|
||||||
|
# search for executables for non-GNU versions of find (eg. BSD)
|
||||||
|
while IFS=$'\n' read -r location; do
|
||||||
|
locations+=("$location");
|
||||||
|
done < <(find "${KUBE_ROOT}/bazel-bin/" -type f -perm -111 \
|
||||||
|
\( -path "*/${platform/\//_}*/${lookfor}" -o -path "*/${lookfor}" \) 2>/dev/null || true)
|
||||||
|
|
||||||
# List most recently-updated location.
|
# List most recently-updated location.
|
||||||
local -r bin=$( (ls -t "${locations[@]}" 2>/dev/null || true) | head -1 )
|
local -r bin=$( (ls -t "${locations[@]}" 2>/dev/null || true) | head -1 )
|
||||||
|
Loading…
Reference in New Issue
Block a user