Skip to content

Commit f8a1a1c

Browse files
authored
Merge pull request #3707 from cdr/jsjoeio-fix-alpine-install-script
fix: update install script for alpine
2 parents 1ff09b8 + 908b2c8 commit f8a1a1c

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

install.sh

+15-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set -eu
33

44
# code-server's automatic install script.
5-
# See https://github.com/cdr/code-server/blob/main/docs/install.md
5+
# See https://github.com/cdr/code-server/blob/main/docs/install
66

77
usage() {
88
arg0="$0"
@@ -58,7 +58,7 @@ Usage:
5858
- If Homebrew is not installed it will install the latest standalone release
5959
into ~/.local
6060
61-
- For FreeBSD, it will install the npm package with yarn or npm.
61+
- For FreeBSD or Alpine, it will install the npm package with yarn or npm.
6262
6363
- If ran on an architecture with no releases, it will install the
6464
npm package with yarn or npm.
@@ -67,7 +67,7 @@ Usage:
6767
6868
It will cache all downloaded assets into ~/.cache/code-server
6969
70-
More installation docs are at https://github.com/cdr/code-server/blob/main/docs/install.md
70+
More installation docs are at https://coder.com/docs/code-server/v3.10.2/install
7171
EOF
7272
}
7373

@@ -238,6 +238,17 @@ main() {
238238
return
239239
fi
240240

241+
if [ "$OS" = "linux" ] && [ "$(distro)" = "alpine" ]; then
242+
if [ "$METHOD" = standalone ]; then
243+
echoerr "No precompiled releases available for alpine."
244+
echoerr 'Please rerun without the "--method standalone" flag to install from npm.'
245+
exit 1
246+
fi
247+
echoh "No precompiled releases available for alpine."
248+
install_npm
249+
return
250+
fi
251+
241252
CACHE_DIR="$(echo_cache_dir)"
242253

243254
if [ "$METHOD" = standalone ]; then
@@ -419,7 +430,7 @@ install_npm() {
419430
echoh
420431
echoerr "Please install npm or yarn to install code-server!"
421432
echoerr "You will need at least node v12 and a few C dependencies."
422-
echoerr "See the docs https://github.com/cdr/code-server/blob/v3.10.2/docs/install.md#yarn-npm"
433+
echoerr "See the docs https://coder.com/docs/code-server/v3.10.2/install#yarn-npm"
423434
exit 1
424435
}
425436

0 commit comments

Comments
 (0)