From 5a6af177256056e316d0056b291fb3a8159c5776 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Thu, 1 Jul 2021 15:49:13 -0700 Subject: [PATCH 1/2] fix: modify install script for alpine --- install.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 63a7574ca..778d78b0d 100755 --- a/install.sh +++ b/install.sh @@ -58,7 +58,7 @@ Usage: - If Homebrew is not installed it will install the latest standalone release into ~/.local -- For FreeBSD, it will install the npm package with yarn or npm. +- For FreeBSD or Alpine, it will install the npm package with yarn or npm. - If ran on an architecture with no releases, it will install the npm package with yarn or npm. @@ -238,6 +238,17 @@ main() { return fi + if [ "$OS" = "linux" ] && [ "$(distro)" = "alpine" ]; then + if [ "$METHOD" = standalone ]; then + echoerr "No precompiled releases available for alpine." + echoerr 'Please rerun without the "--method standalone" flag to install from npm.' + exit 1 + fi + echoh "No precompiled releases available for alpine." + install_npm + return + fi + CACHE_DIR="$(echo_cache_dir)" if [ "$METHOD" = standalone ]; then @@ -473,6 +484,11 @@ distro() { ) return fi + + if [ -f /etc/alpine-release ]; then + echo "alpine" + return + fi } # os_name prints a pretty human readable name for the OS/Distro. From 908b2c8502a5a5d6ef27bd1397e6b7d3dea7abcc Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 2 Jul 2021 10:19:49 -0700 Subject: [PATCH 2/2] fix: use new docs links in install script --- install.sh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/install.sh b/install.sh index 778d78b0d..b53d70373 100755 --- a/install.sh +++ b/install.sh @@ -2,7 +2,7 @@ set -eu # code-server's automatic install script. -# See https://github.com/cdr/code-server/blob/main/docs/install.md +# See https://github.com/cdr/code-server/blob/main/docs/install usage() { arg0="$0" @@ -67,7 +67,7 @@ Usage: It will cache all downloaded assets into ~/.cache/code-server -More installation docs are at https://github.com/cdr/code-server/blob/main/docs/install.md +More installation docs are at https://coder.com/docs/code-server/v3.10.2/install EOF } @@ -430,7 +430,7 @@ install_npm() { echoh echoerr "Please install npm or yarn to install code-server!" echoerr "You will need at least node v12 and a few C dependencies." - echoerr "See the docs https://github.com/cdr/code-server/blob/v3.10.2/docs/install.md#yarn-npm" + echoerr "See the docs https://coder.com/docs/code-server/v3.10.2/install#yarn-npm" exit 1 } @@ -484,11 +484,6 @@ distro() { ) return fi - - if [ -f /etc/alpine-release ]; then - echo "alpine" - return - fi } # os_name prints a pretty human readable name for the OS/Distro.