As before we default to /usr/local but now we switch to ~/.local if /usr/local if not accessible instead of prompting for sudo. Instead of having an exception for macOS/arm64. Of course if a user wants to install in /usr/local anyway, they can still pass --prefix /usr/local to force installation into /usr/local and prompt for sudo.
29 lines
515 B
Bash
Executable file
29 lines
515 B
Bash
Executable file
#!/bin/sh
|
|
set -eu
|
|
|
|
cat <<EOF
|
|
# d2
|
|
|
|
For docs, more installation options and the source code see https://oss.terrastruct.com/d2
|
|
|
|
version: $VERSION
|
|
|
|
## 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
|