Skip to content

Commit e14f8fb

Browse files
authored
fix(install.sh): install from github when using --stable on macOS (coder#13216)
1 parent 6790993 commit e14f8fb

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

install.sh

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -373,14 +373,6 @@ main() {
373373
ARCH=${ARCH:-$(arch)}
374374
TERRAFORM_ARCH=${TERRAFORM_ARCH:-$(terraform_arch)}
375375

376-
# We can't reasonably support installing specific versions of Coder through
377-
# Homebrew, so if we're on macOS and the `--version` flag was set, we should
378-
# "detect" standalone to be the appropriate installation method. This check
379-
# needs to occur before we set `VERSION` to a default of the latest release.
380-
if [ "$OS" = "darwin" ] && [ "${VERSION-}" ]; then
381-
METHOD=standalone
382-
fi
383-
384376
# If we've been provided a flag which is specific to the standalone installation
385377
# method, we should "detect" standalone to be the appropriate installation method.
386378
# This check needs to occur before we set these variables with defaults.
@@ -395,6 +387,15 @@ main() {
395387
exit 1
396388
fi
397389

390+
# We can't reasonably support installing specific versions of Coder through
391+
# Homebrew, so if we're on macOS and the `--version` flag or the `--stable`
392+
# flag (our tap follows mainline) was set, we should "detect" standalone to
393+
# be the appropriate installation method. This check needs to occur before we
394+
# set `VERSION` to a default of the latest release.
395+
if [ "$OS" = "darwin" ] && { [ "${VERSION-}" ] || [ "${STABLE}" = 1 ]; }; then
396+
METHOD=standalone
397+
fi
398+
398399
# These are used by the various install_* functions that make use of GitHub
399400
# releases in order to download and unpack the right release.
400401
CACHE_DIR=$(echo_cache_dir)

0 commit comments

Comments
 (0)