2022-11-11 09:17:06 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
set -eu
|
2022-12-08 03:14:05 +00:00
|
|
|
cd -- "$(dirname "$0")/../../.."
|
|
|
|
|
. ./ci/sub/lib.sh
|
2022-11-11 09:17:06 +00:00
|
|
|
|
|
|
|
|
cat <<EOF
|
|
|
|
|
# d2
|
|
|
|
|
|
2022-11-12 22:19:09 +00:00
|
|
|
For docs, more installation options and the source code see https://oss.terrastruct.com/d2
|
|
|
|
|
|
2022-11-11 09:17:06 +00:00
|
|
|
version: $VERSION
|
2022-12-08 03:14:05 +00:00
|
|
|
os: $OS
|
|
|
|
|
arch: $ARCH
|
|
|
|
|
|
|
|
|
|
Built with $(go version | grep -o 'go[^ ]\+').
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
ensure_os
|
|
|
|
|
if [ "$OS" = windows ]; then
|
|
|
|
|
cat <<EOF
|
|
|
|
|
|
2022-12-08 03:42:58 +00:00
|
|
|
We currently do not have an \`.msi\` for automatic installation on Windows so this release
|
|
|
|
|
is structured the same as our Unix releases.
|
2022-12-08 03:30:04 +00:00
|
|
|
|
2022-12-08 03:42:58 +00:00
|
|
|
Easiest way to use d2 on Windows is to just \`chdir\` into the bin directory of this release
|
|
|
|
|
and invoke d2 like \`./d2 <full-input-file-path>\`
|
2022-12-08 03:30:04 +00:00
|
|
|
|
2022-12-08 03:42:58 +00:00
|
|
|
For installation you'll have to add the \`./bin/d2.exe\` binary to your \`\$PATH\`. Or add
|
|
|
|
|
the \`./bin\` directory of this release to your \`\$PATH\`.
|
2022-12-08 03:14:05 +00:00
|
|
|
|
2022-12-08 03:42:58 +00:00
|
|
|
See https://www.wikihow.com/Change-the-PATH-Environment-Variable-on-Windows
|
|
|
|
|
|
|
|
|
|
Then you'll be able to call \`d2\` from the commandline in \`cmd.exe\` or \`pwsh.exe\`.
|
2022-12-08 03:14:05 +00:00
|
|
|
|
2022-12-08 03:32:26 +00:00
|
|
|
We intend to have a \`.msi\` release installer sometime soon that handles putting \`d2\` into
|
|
|
|
|
your \`\$PATH\` for you.
|
|
|
|
|
|
2022-12-08 03:42:58 +00:00
|
|
|
You can also use \`make install\` to install on Windows after first installing
|
|
|
|
|
[MSYS2](https://www.msys2.org/) which emulates a Linux shell for Windows. Its terminal
|
|
|
|
|
also enables d2 to show colors in its output. The manpage will also become accessible
|
|
|
|
|
with \`man d2\`.
|
|
|
|
|
|
2022-12-08 03:14:05 +00:00
|
|
|
See https://github.com/terrastruct/d2/blob/master/docs/INSTALL.md#windows
|
|
|
|
|
EOF
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
cat <<EOF
|
2022-11-11 09:17:06 +00:00
|
|
|
|
|
|
|
|
## Install
|
|
|
|
|
|
2022-11-12 22:19:09 +00:00
|
|
|
\`\`\`sh
|
2022-11-14 13:37:11 +00:00
|
|
|
make install DRY_RUN=1
|
2022-11-12 22:19:09 +00:00
|
|
|
# If it looks right, run:
|
2022-12-06 05:51:46 +00:00
|
|
|
# make install
|
2022-11-12 22:19:09 +00:00
|
|
|
\`\`\`
|
|
|
|
|
|
2022-12-06 05:51:46 +00:00
|
|
|
Pass \`PREFIX=somepath\` to change the installation prefix from the default which is
|
|
|
|
|
\`/usr/local\` or \`~/.local\` if \`/usr/local\` is not writable with the current user.
|
2022-11-14 13:37:11 +00:00
|
|
|
|
2022-11-12 22:19:09 +00:00
|
|
|
## Uninstall
|
|
|
|
|
|
|
|
|
|
\`\`\`sh
|
2022-11-14 13:37:11 +00:00
|
|
|
make uninstall DRY_RUN=1
|
2022-11-12 22:19:09 +00:00
|
|
|
# If it looks right, run:
|
2022-12-06 05:51:46 +00:00
|
|
|
# make uninstall
|
2022-11-12 22:19:09 +00:00
|
|
|
\`\`\`
|
2022-11-11 09:17:06 +00:00
|
|
|
EOF
|