From 116151cc823d152356bcb5452324ee00764abd99 Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Thu, 1 Dec 2022 13:14:09 -0800 Subject: [PATCH] INSTALL.md: Demonstrate minimal script to install standalone release Closes #150 --- ci/release/changelogs/next.md | 4 ++-- ci/release/changelogs/template.md | 4 ++-- docs/INSTALL.md | 31 +++++++++++++++++++++++++++---- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md index bb3d79e4f..6446165c6 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -1,4 +1,4 @@ -#### Features ๐Ÿš€ +#### Features ๐Ÿ’ธ - Formatting of d2 scripts is supported on the CLI with the `fmt` subcommand. [#292](https://github.com/terrastruct/d2/pull/292) @@ -32,7 +32,7 @@ - `BROWSER=0` now works to disable opening a browser on `--watch`. [#311](https://github.com/terrastruct/d2/pull/311) -#### Bugfixes ๐Ÿ”ด +#### Bugfixes โ›‘๏ธ - 3D style was missing border and other styles for its top and right faces. [#187](https://github.com/terrastruct/d2/pull/187) diff --git a/ci/release/changelogs/template.md b/ci/release/changelogs/template.md index e5cf9fc34..131061b70 100644 --- a/ci/release/changelogs/template.md +++ b/ci/release/changelogs/template.md @@ -1,5 +1,5 @@ -#### Features ๐Ÿš€ +#### Features ๐Ÿ’ธ #### Improvements ๐Ÿงน -#### Bugfixes ๐Ÿ”ด +#### Bugfixes โ›‘๏ธ diff --git a/docs/INSTALL.md b/docs/INSTALL.md index d128de725..efc1e948b 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -7,6 +7,8 @@ You may install D2 through any of the following methods. - Security - macOS (Homebrew) - Standalone + - Manual + - PREFIX - From source - Coming soon @@ -76,8 +78,28 @@ brew install d2 ## Standalone 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 make install @@ -89,10 +111,11 @@ Run the following to 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: -``` +```sh # Install under ~/.local. # Binaries will be at ~/.local/bin # And manpages will be under ~/.local/share/man