Skip to content

Commit 6ffe388

Browse files
author
Akash Satheesan
authored
Merge d54da76 into 02a0e05
2 parents 02a0e05 + d54da76 commit 6ffe388

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

ci/build/npm-postinstall.sh

+19-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
#!/usr/bin/env sh
22
set -eu
33

4+
# Copied from arch() in ci/lib.sh.
5+
detect_arch() {
6+
case "$(uname -m)" in
7+
aarch64)
8+
echo arm64
9+
;;
10+
x86_64 | amd64)
11+
echo amd64
12+
;;
13+
*)
14+
# This will cause the download to fail, but is intentional
15+
uname -m
16+
;;
17+
esac
18+
}
19+
20+
ARCH="${NPM_CONFIG_ARCH:-$(detect_arch)}"
21+
422
main() {
523
# Grabs the major version of node from $npm_config_user_agent which looks like
624
# yarn/1.21.1 npm/? node/v14.2.0 darwin x64
@@ -25,7 +43,7 @@ main() {
2543
esac
2644

2745
OS="$(uname | tr '[:upper:]' '[:lower:]')"
28-
if curl -fsSL "https://storage.googleapis.com/coder-cloud-releases/agent/latest/$OS/cloud-agent" -o ./lib/coder-cloud-agent; then
46+
if curl -fsSL "https://github.com/cdr/cloud-agent/releases/latest/download/cloud-agent-$OS-$ARCH" -o ./lib/coder-cloud-agent; then
2947
chmod +x ./lib/coder-cloud-agent
3048
else
3149
echo "Failed to download cloud agent; --link will not work"

0 commit comments

Comments
 (0)