d2/ci/release/template/README.md.sh

69 lines
1.8 KiB
Bash
Raw Normal View History

2022-11-11 09:17:06 +00:00
#!/bin/sh
set -eu
cd -- "$(dirname "$0")/../../.."
. ./ci/sub/lib.sh
2022-11-11 09:17:06 +00:00
2022-12-08 10:32:09 +00:00
ensure_os
ensure_arch
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
os: $OS
arch: $ARCH
Built with $(go version | grep -o 'go[^ ]\+').
EOF
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 10:32:09 +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: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: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 10:32:09 +00:00
We intend to have a \`.msi\` release installer sometime soon that handles putting \`d2.exe\` 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
2022-12-08 10:32:09 +00:00
also enables \`d2\` to show colors in its output. The manpage will also become accessible
2022-12-08 03:42:58 +00:00
with \`man d2\`.
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
make install DRY_RUN=1
2022-11-12 22:19:09 +00:00
# If it looks right, run:
# make install
2022-11-12 22:19:09 +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-12 22:19:09 +00:00
## Uninstall
\`\`\`sh
make uninstall DRY_RUN=1
2022-11-12 22:19:09 +00:00
# If it looks right, run:
# make uninstall
2022-11-12 22:19:09 +00:00
\`\`\`
2022-11-11 09:17:06 +00:00
EOF