meanas/scripts/configure_docs_url.sh

25 lines
476 B
Bash
Raw Normal View History

2026-04-18 22:58:38 -07:00
#!/bin/bash
set -Eeuo pipefail
ROOT="$(git rev-parse --show-toplevel)"
cd "$ROOT"
if [[ $# -gt 1 ]]; then
echo "usage: $0 [docs-site-url]" >&2
exit 2
fi
if [[ $# -eq 1 ]]; then
git config meanas.docsSiteUrl "$1"
echo "Configured meanas.docsSiteUrl=$1"
exit 0
fi
CURRENT_URL="$(git config --get meanas.docsSiteUrl || true)"
if [[ -n "$CURRENT_URL" ]]; then
echo "$CURRENT_URL"
else
echo "meanas.docsSiteUrl is not configured" >&2
exit 1
fi