install.sh: Add our own flag parser

Fully supports long opts!
This commit is contained in:
Anmol Sethi
2020-05-21 15:17:02 -04:00
parent 0129e002e8
commit 510d84898c
7 changed files with 220 additions and 85 deletions

View File

@@ -17,28 +17,54 @@ For a full setup and walkthrough, please see [./doc/guide.md](./doc/guide.md).
## Install
You can easily and securely install code-server with our install script.
You can easily and securely install code-server with our install script on any Linux or macOS machine.
```bash
# First run to print out the install process.
curl -sSL https://get.docker.com/ | sh -s -- --dry-run
curl -fsSL https://code-server.dev/install.sh | sh -s -- --dry-run
# Now it will actually install.
curl -sSL https://get.docker.com/ | sh -s --
curl -fsSL https://code-server.dev/install.sh | sh
```
```
$ curl -fsSL https://code-server.dev/install.sh | sh -s -- --dry-run --help
Installs latest code-server on any macOS or Linux system preferring to use the OS package manager.
curl -fsSL https://code-server.dev/install.sh | sh -s --
- For Debian, Ubuntu, Raspbian it will install the latest deb package.
- For Fedora, CentOS, RHEL, openSUSE it will install the latest rpm package.
- For Arch Linux it will install the AUR package.
- For any unrecognized Linux operating system it will install the latest static release into `/usr/local/lib/code-server-X.X.X`.
- For macOS it will install the Homebrew package.
- If Homebrew is not installed it will install the latest static release into `/usr/local/lib/code-server-X.X.X`.
- For any unrecognized Linux operating system it will install the latest static release into ~/.local
- Add ~/.local/bin to your $PATH to run code-server.
If ran on an architecture with no binary releases, it will install the npm package with `yarn` or `npm`.
We only have binary releases for `amd64` and `arm64` presently.
- For macOS it will install the Homebrew package.
- If Homebrew is not installed it will install the latest static release into ~/.local
- Add ~/.local/bin to your $PATH to run code-server.
- If ran on an architecture with no binary releases or outdated libc/libcxx, it will install the
npm package with yarn or npm.
- We only have binary releases for amd64 and arm64 presently.
--dry-run Enables a dry run where where the steps that would have taken place
are printed but do not actually execute.
--static Forces the installation of a static release into ~/.local
This flag takes an optional argument for the installation prefix which defaults to "~/.local".
code-server will be unarchived into ~/.local/lib/code-server.X.X.X and the binary will be symlinked
into "~/.local/bin/code-server". You will need to add ~/.local/bin to your $PATH to use it without
the full path.
To install system wide set the prefix to /usr/local.
--version Pass to install a specific version instead of the latest release.
```
If you still don't trust our install script, even with the above explaination and the dry run, we have
docs in [./doc/install.md](./doc/install.md) that explain how to install `code-server` each of the above
operating systems. The script runs the exact same commands.
docs in [./doc/install.md](./doc/install.md) that explain how to install `code-server` on a variety of
platforms. The script runs the exact same commands.
### Docker
@@ -53,6 +79,8 @@ docker run -it -p 127.0.0.1:8080:8080 \
codercom/code-server:latest
```
You should also check out
## FAQ
See [./doc/FAQ.md](./doc/FAQ.md).