Skip to content

fix: update install script for alpine #3707

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this also go to coder.com? Without .md it seems to 404.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dang it. I did a serach for .md and must have accidentally done a search and replace. I'll fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


usage() {
arg0="$0"
Expand Down Expand Up @@ -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.
Expand All @@ -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
}

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -419,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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you planning to bump the version number each release, or should we link to /latest/ here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If so, I think we should replace latest with the version number in this case actually so that old docs will link to the correct branch.

I think @bpmct and @BrunoQuaresma thought we should use the version (source).

We do have a script called release-prep.sh which handles updating these links for us. See here

Copy link
Contributor

@BrunoQuaresma BrunoQuaresma Jul 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we want to keep the version so the script release-prep can handle the update for us.

exit 1
}

Expand Down