Skip to content
This repository was archived by the owner on Jan 17, 2021. It is now read-only.

add x86_64 check in downloadScript #111

Merged
merged 3 commits into from
Jun 27, 2019
Merged

add x86_64 check in downloadScript #111

merged 3 commits into from
Jun 27, 2019

Conversation

deansheather
Copy link
Member

Adds a check to the download script to make sure the output of uname -m is x86_64 as code-server doesn't have releases for other platforms. If the architecture isn't supported you get output similar to the following:

go run . --skipsync fuyumi
2019-05-27 16:15:49 INFO	ensuring code-server is updated...
++ uname -m
+ '[' i686 != x86_64 ']'
++ uname -m
Unsupported server architecture i686. code-server only has releases for x86_64 systems.
+ echo 'Unsupported server architecture i686. code-server only has releases for x86_64 systems.'
+ exit 1
2019-05-27 16:15:50 FATAL	error: failed to update code-server:
---ssh cmd---
ssh  fuyumi /bin/bash
---download script---
set -euxo pipefail || exit 1

[ "$(uname -m)" != "x86_64" ] && echo "Unsupported server architecture $(uname -m). code-server only has releases for x86_64 systems." && exit 1
pkill -f ~/.cache/sshcode/sshcode-server || true
mkdir -p ~/.local/share/code-server ~/.cache/sshcode
cd ~/.cache/sshcode
wget -N https://codesrv-ci.cdr.sh/latest-linux
[ -f ~/.cache/sshcode/sshcode-server ] && rm ~/.cache/sshcode/sshcode-server
ln latest-linux ~/.cache/sshcode/sshcode-server
chmod +x ~/.cache/sshcode/sshcode-server: exit status 1
exit status 1

Closes #92.

Copy link

@frank-dspeed frank-dspeed left a comment

Choose a reason for hiding this comment

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

This is a valid Solution LGTM

@deansheather deansheather requested a review from sreya June 11, 2019 10:08
@sreya
Copy link
Collaborator

sreya commented Jun 11, 2019

Can't the same objective be achieved by adding a statement to the README?

@deansheather
Copy link
Member Author

Well, we could add a warning to the README too. I think having the sanity check as well will prevent users from being confused with possibly cryptic error messages if they didn't entirely read the README though.

@sreya
Copy link
Collaborator

sreya commented Jun 17, 2019

This is fine since we're only supporting one arch but that conditional statement will gradually get uglier as more architectures are supported (if that ever happens), seems cleaner to me to have the user refer to the README

@deansheather
Copy link
Member Author

Added a remote server OS support paragraph in the README.

@deansheather deansheather merged commit 6ada57c into coder:master Jun 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check if remote system is 32bit before downloading
3 participants