Skip to content

Commit 961ddad

Browse files
authored
fix: use command -v instead of which in agent bootstrap (#2307)
Certain distros don't ship with `which` (arch) and `command -v` is built-in to the shell, so this is much more compatible.
1 parent 0a949aa commit 961ddad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

provisionersdk/agent.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ Start-Process -FilePath $env:TEMP\sshd.exe -ArgumentList "agent" -PassThru`
2020
set -eux pipefail
2121
BINARY_LOCATION=$(mktemp -d -t tmp.coderXXXXXX)/coder
2222
BINARY_URL=${ACCESS_URL}bin/coder-linux-${ARCH}
23-
if which curl >/dev/null 2>&1; then
23+
if command -v curl >/dev/null 2>&1; then
2424
curl -fsSL --compressed "${BINARY_URL}" -o "${BINARY_LOCATION}"
25-
elif which wget >/dev/null 2>&1; then
25+
elif command -v wget >/dev/null 2>&1; then
2626
wget -q "${BINARY_URL}" -O "${BINARY_LOCATION}"
27-
elif which busybox >/dev/null 2>&1; then
27+
elif command -v busybox >/dev/null 2>&1; then
2828
busybox wget -q "${BINARY_URL}" -O "${BINARY_LOCATION}"
2929
else
3030
echo "error: no download tool found, please install curl, wget or busybox wget"

0 commit comments

Comments
 (0)