@@ -67,8 +67,8 @@ The detection method works as follows:
67
67
- Debian, Ubuntu, Raspbian: install the deb package from GitHub.
68
68
- Fedora, CentOS, RHEL, openSUSE: install the rpm package from GitHub.
69
69
- Alpine: install the apk package from GitHub.
70
- - macOS: install the release from GitHub .
71
- - All others: install the release from GitHub .
70
+ - macOS: if \` brew \` is available, install from the coder/coder Homebrew tap .
71
+ - Otherwise, download from GitHub and install into \` --prefix \` .
72
72
73
73
We build releases on GitHub for amd64, armv7, and arm64 on Windows, Linux, and macOS.
74
74
@@ -118,6 +118,26 @@ Run Coder:
118
118
EOF
119
119
}
120
120
121
+ echo_brew_postinstall () {
122
+ if [ " ${DRY_RUN-} " ]; then
123
+ echo_dryrun_postinstall
124
+ return
125
+ fi
126
+
127
+ cath << EOF
128
+ brew formula has been installed.
129
+
130
+ To run a Coder server:
131
+
132
+ $ coder server
133
+
134
+ To connect to a Coder deployment:
135
+
136
+ $ coder login <deployment url>
137
+
138
+ EOF
139
+ }
140
+
121
141
echo_systemd_postinstall () {
122
142
if [ " ${DRY_RUN-} " ]; then
123
143
echo_dryrun_postinstall
@@ -303,9 +323,7 @@ main() {
303
323
DISTRO=${DISTRO:- $(distro)}
304
324
305
325
case $DISTRO in
306
- # macOS uses the standalone installation for now.
307
- # Homebrew support is planned. See: https://github.com/coder/coder/issues/1925
308
- macos) install_standalone ;;
326
+ darwin) install_macos ;;
309
327
# The .deb and .rpm files are pulled from GitHub.
310
328
debian) install_deb ;;
311
329
fedora | opensuse) install_rpm ;;
@@ -408,6 +426,23 @@ with_terraform() {
408
426
" $sh_c " cp " $CACHE_DIR /terraform" " $COPY_LOCATION "
409
427
}
410
428
429
+ install_macos () {
430
+ # If there is no `brew` binary available, just default to installing standalone
431
+ if command_exists brew; then
432
+ echoh " Installing v$VERSION of the coder formula from coder/coder."
433
+ echoh
434
+
435
+ sh_c brew install coder/coder/coder
436
+
437
+ echo_brew_postinstall
438
+ return
439
+ fi
440
+
441
+ echoh " Homebrew is not available."
442
+ echoh " Falling back to standalone installation."
443
+ install_standalone
444
+ }
445
+
411
446
install_deb () {
412
447
echoh " Installing v$VERSION of the $ARCH deb package from GitHub."
413
448
echoh
0 commit comments