@@ -14,7 +14,7 @@ usage() {
14
14
fi
15
15
16
16
cath << EOF
17
- Installs code-server for Linux and macOS .
17
+ Installs code-server for Linux, macOS and FreeBSD .
18
18
It tries to use the system package manager if possible.
19
19
After successful installation it explains how to start using code-server.
20
20
${not_curl_usage-}
48
48
- If Homebrew is not installed it will install the latest standalone release
49
49
into ~/.local
50
50
51
+ - For FreeBSD, it will install the npm package with yarn or npm.
52
+
51
53
- If ran on an architecture with no releases, it will install the
52
54
npm package with yarn or npm.
53
55
- We only have releases for amd64 and arm64 presently.
@@ -160,7 +162,7 @@ main() {
160
162
ARCH=" $( arch) "
161
163
if [ ! " $ARCH " ]; then
162
164
if [ " $METHOD " = standalone ]; then
163
- echoerr " No releases available for the architecture $( uname -m) ."
165
+ echoerr " No precompiled releases for $( uname -m) ."
164
166
echoerr ' Please rerun without the "--method standalone" flag to install from npm.'
165
167
exit 1
166
168
fi
@@ -169,6 +171,17 @@ main() {
169
171
return
170
172
fi
171
173
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
+
172
185
CACHE_DIR=" $( echo_cache_dir) "
173
186
174
187
if [ " $METHOD " = standalone ]; then
@@ -360,6 +373,9 @@ os() {
360
373
Darwin)
361
374
echo macos
362
375
;;
376
+ FreeBSD)
377
+ echo freebsd
378
+ ;;
363
379
esac
364
380
}
365
381
@@ -371,11 +387,12 @@ os() {
371
387
# - centos, fedora, rhel, opensuse
372
388
# - alpine
373
389
# - arch
390
+ # - freebsd
374
391
#
375
392
# Inspired by https://github.com/docker/docker-install/blob/26ff363bcf3b3f5a00498ac43694bf1c7d9ce16c/install.sh#L111-L120.
376
393
distro () {
377
- if [ " $( uname ) " = " Darwin " ]; then
378
- echo " macos "
394
+ if [ " $OS " = " macos " ] || [ " $OS " = " freebsd " ]; then
395
+ echo " $OS "
379
396
return
380
397
fi
381
398
@@ -422,6 +439,9 @@ arch() {
422
439
x86_64)
423
440
echo amd64
424
441
;;
442
+ amd64) # FreeBSD.
443
+ echo amd64
444
+ ;;
425
445
esac
426
446
}
427
447
0 commit comments