INSTALL.md: Demonstrate minimal script to install standalone release

Closes #150
This commit is contained in:
Anmol Sethi 2022-12-01 13:14:09 -08:00
parent f333cb1a2b
commit 116151cc82
No known key found for this signature in database
GPG key ID: 25BC68888A99A8BA
3 changed files with 31 additions and 8 deletions

View file

@ -1,4 +1,4 @@
#### Features 🚀 #### Features 💸
- Formatting of d2 scripts is supported on the CLI with the `fmt` subcommand. - Formatting of d2 scripts is supported on the CLI with the `fmt` subcommand.
[#292](https://github.com/terrastruct/d2/pull/292) [#292](https://github.com/terrastruct/d2/pull/292)
@ -32,7 +32,7 @@
- `BROWSER=0` now works to disable opening a browser on `--watch`. - `BROWSER=0` now works to disable opening a browser on `--watch`.
[#311](https://github.com/terrastruct/d2/pull/311) [#311](https://github.com/terrastruct/d2/pull/311)
#### Bugfixes 🔴 #### Bugfixes ⛑️
- 3D style was missing border and other styles for its top and right faces. - 3D style was missing border and other styles for its top and right faces.
[#187](https://github.com/terrastruct/d2/pull/187) [#187](https://github.com/terrastruct/d2/pull/187)

View file

@ -1,5 +1,5 @@
#### Features 🚀 #### Features 💸
#### Improvements 🧹 #### Improvements 🧹
#### Bugfixes 🔴 #### Bugfixes ⛑️

View file

@ -7,6 +7,8 @@ You may install D2 through any of the following methods.
- <a href="#security" id="toc-security">Security</a> - <a href="#security" id="toc-security">Security</a>
- <a href="#macos-homebrew" id="toc-macos-homebrew">macOS (Homebrew)</a> - <a href="#macos-homebrew" id="toc-macos-homebrew">macOS (Homebrew)</a>
- <a href="#standalone" id="toc-standalone">Standalone</a> - <a href="#standalone" id="toc-standalone">Standalone</a>
- <a href="#manual" id="toc-manual">Manual</a>
- <a href="#prefix" id="toc-prefix">PREFIX</a>
- <a href="#from-source" id="toc-from-source">From source</a> - <a href="#from-source" id="toc-from-source">From source</a>
- <a href="#coming-soon" id="toc-coming-soon">Coming soon</a> - <a href="#coming-soon" id="toc-coming-soon">Coming soon</a>
@ -76,8 +78,28 @@ brew install d2
## Standalone ## Standalone
We publish standalone release archives for every release on Github. We publish standalone release archives for every release on Github.
Download the `.tar.gz` release for your OS/ARCH combination and then run the following
inside the extracted directory to install: Here's a minimal example script that downloads a standalone release, extracts it into the
current directory and then installs it.
Adjust VERSION, OS, and ARCH as needed.
```sh
VERSION=v0.0.13 OS=macos ARCH=amd64 curl -fsSLO \
"https://github.com/terrastruct/d2/releases/download/$VERSION/d2-$VERSION-$OS-$ARCH.tar.gz" \
&& tar -xzf "d2-$VERSION-$OS-$ARCH.tar.gz" \
&& make -sC "d2-$VERSION" install
```
To uninstall:
```sh
VERSION=v0.0.13 make -sC "d2-$VERSION" uninstall
```
### Manual
You can also manually download the `.tar.gz` release for your OS/ARCH combination and then
run the following inside the extracted directory to install:
```sh ```sh
make install make install
@ -89,10 +111,11 @@ Run the following to uninstall:
make uninstall make uninstall
``` ```
If root permissions are required for installation, you'll need to run `make` with `sudo`. ### PREFIX
You can control the Unix hierarchy installation path with `PREFIX=`. For example: You can control the Unix hierarchy installation path with `PREFIX=`. For example:
``` ```sh
# Install under ~/.local. # Install under ~/.local.
# Binaries will be at ~/.local/bin # Binaries will be at ~/.local/bin
# And manpages will be under ~/.local/share/man # And manpages will be under ~/.local/share/man