@@ -17,18 +17,28 @@ $env:CODER_AGENT_URL = "${ACCESS_URL}"
17
17
Start-Process -FilePath $env:TEMP\sshd.exe -ArgumentList "agent" -PassThru`
18
18
19
19
linuxScript = `#!/usr/bin/env sh
20
- set -eu pipefail
21
- export BINARY_LOCATION=$(mktemp -d -t tmp.coderXXXXX)/coder
22
- curl -fsSL ${ACCESS_URL}bin/coder-linux-${ARCH} -o $BINARY_LOCATION
20
+ set -eux pipefail
21
+ BINARY_LOCATION=$(mktemp -d -t tmp.coderXXXXXX)/coder
22
+ BINARY_URL=${ACCESS_URL}bin/coder-linux-${ARCH}
23
+ if which curl >/dev/null 2>&1; then
24
+ curl -fsSL "${BINARY_URL}" -o "${BINARY_LOCATION}"
25
+ elif which wget >/dev/null 2>&1; then
26
+ wget -q "${BINARY_URL}" -O "${BINARY_LOCATION}"
27
+ elif which busybox >/dev/null 2>&1; then
28
+ busybox wget -q "${BINARY_URL}" -O "${BINARY_LOCATION}"
29
+ else
30
+ echo "error: no download tool found, please install curl, wget or busybox wget"
31
+ exit 1
32
+ fi
23
33
chmod +x $BINARY_LOCATION
24
34
export CODER_AGENT_AUTH="${AUTH_TYPE}"
25
35
export CODER_AGENT_URL="${ACCESS_URL}"
26
36
exec $BINARY_LOCATION agent`
27
37
28
38
darwinScript = `#!/usr/bin/env sh
29
- set -eu pipefail
30
- export BINARY_LOCATION=$(mktemp -d -t tmp.coderXXXXX )/coder
31
- curl -fsSL ${ACCESS_URL}bin/coder-darwin-${ARCH} -o $ BINARY_LOCATION
39
+ set -eux pipefail
40
+ BINARY_LOCATION=$(mktemp -d -t tmp.coderXXXXXX )/coder
41
+ curl -fsSL " ${ACCESS_URL}bin/coder-darwin-${ARCH}" -o "${ BINARY_LOCATION}"
32
42
chmod +x $BINARY_LOCATION
33
43
export CODER_AGENT_AUTH="${AUTH_TYPE}"
34
44
export CODER_AGENT_URL="${ACCESS_URL}"
0 commit comments