d2/ci/release/template
2023-03-29 17:29:30 -07:00
..
man accept font input 2023-03-29 17:29:30 -07:00
scripts install.sh: Regen [ci-force] 2023-01-24 14:59:43 -08:00
LICENSE.txt ci/release: Checkpoint 2022-11-13 22:49:45 -08:00
Makefile install.sh: Improve default $PREFIX behaviour 2022-12-05 22:15:58 -08:00
README.md.sh release/README.md: Update Windows template to reflect .msi installer 2022-12-18 11:49:22 -08:00

#!/bin/sh
set -eu
cd -- "$(dirname "$0")/../../.."
. ./ci/sub/lib.sh

ensure_os
ensure_arch
cat <<EOF
# d2

For docs, more installation options and the source code see https://oss.terrastruct.com/d2

version: $VERSION
os: $OS
arch: $ARCH

Built with $(go version | grep -o 'go[^ ]\+').
EOF

if [ "$OS" = windows ]; then
  cat <<EOF

This release is structured the same as our Unix releases for use with MSYS2.

You may find our \`.msi\` installer more convenient as it handles putting \`d2.exe\` into
your \`\$PATH\` for you.

See https://github.com/terrastruct/d2/blob/master/docs/INSTALL.md#windows
EOF
fi

cat <<EOF

## Install

\`\`\`sh
make install DRY_RUN=1
# If it looks right, run:
# make install
\`\`\`

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.

## Uninstall

\`\`\`sh
make uninstall DRY_RUN=1
# If it looks right, run:
# make uninstall
\`\`\`
EOF