@@ -14,7 +14,7 @@ usage() {
1414 fi
1515
1616 cath << EOF
17- Installs code-server for Linux and macOS .
17+ Installs code-server for Linux, macOS and FreeBSD .
1818It tries to use the system package manager if possible.
1919After successful installation it explains how to start using code-server.
2020${not_curl_usage-}
4848 - If Homebrew is not installed it will install the latest standalone release
4949 into ~/.local
5050
51+ - For FreeBSD, it will install the npm package with yarn or npm.
52+
5153- If ran on an architecture with no releases, it will install the
5254 npm package with yarn or npm.
5355 - We only have releases for amd64 and arm64 presently.
@@ -160,7 +162,7 @@ main() {
160162 ARCH=" $( arch) "
161163 if [ ! " $ARCH " ]; then
162164 if [ " $METHOD " = standalone ]; then
163- echoerr " No releases available for the architecture $( uname -m) ."
165+ echoerr " No precompiled releases for $( uname -m) ."
164166 echoerr ' Please rerun without the "--method standalone" flag to install from npm.'
165167 exit 1
166168 fi
@@ -169,6 +171,17 @@ main() {
169171 return
170172 fi
171173
174+ if [ " $OS " = " freebsd" ]; then
175+ if [ " $METHOD " = standalone ]; then
176+ echoerr " No precompiled releases available for $OS ."
177+ echoerr ' Please rerun without the "--method standalone" flag to install from npm.'
178+ exit 1
179+ fi
180+ echoh " No precompiled releases available for $OS ."
181+ install_npm
182+ return
183+ fi
184+
172185 CACHE_DIR=" $( echo_cache_dir) "
173186
174187 if [ " $METHOD " = standalone ]; then
@@ -360,6 +373,9 @@ os() {
360373 Darwin)
361374 echo macos
362375 ;;
376+ FreeBSD)
377+ echo freebsd
378+ ;;
363379 esac
364380}
365381
@@ -371,11 +387,12 @@ os() {
371387# - centos, fedora, rhel, opensuse
372388# - alpine
373389# - arch
390+ # - freebsd
374391#
375392# Inspired by https://github.com/docker/docker-install/blob/26ff363bcf3b3f5a00498ac43694bf1c7d9ce16c/install.sh#L111-L120.
376393distro () {
377- if [ " $( uname ) " = " Darwin " ]; then
378- echo " macos "
394+ if [ " $OS " = " macos " ] || [ " $OS " = " freebsd " ]; then
395+ echo " $OS "
379396 return
380397 fi
381398
@@ -422,6 +439,9 @@ arch() {
422439 x86_64)
423440 echo amd64
424441 ;;
442+ amd64) # FreeBSD.
443+ echo amd64
444+ ;;
425445 esac
426446}
427447
0 commit comments