mirror of
https://github.com/jpawlowski/hass.tibber_prices.git
synced 2026-05-28 18:43:40 +00:00
Apply consistent 4-space indentation and trailing-operator style for line continuations (&&, |) across all development and release scripts. No logic changes. Release-Notes: skip
43 lines
834 B
Bash
43 lines
834 B
Bash
#!/usr/bin/env bash
|
|
# Build only Docusaurus site(s) impacted by current staged file set.
|
|
|
|
set -euo pipefail
|
|
|
|
REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
|
cd "$REPO_ROOT"
|
|
|
|
build_user=false
|
|
build_developer=false
|
|
|
|
for file in "$@"; do
|
|
case "$file" in
|
|
docs/user/*)
|
|
build_user=true
|
|
;;
|
|
docs/developer/*)
|
|
build_developer=true
|
|
;;
|
|
esac
|
|
done
|
|
|
|
if [[ "$build_user" == false && "$build_developer" == false ]]; then
|
|
exit 0
|
|
fi
|
|
|
|
if [[ "$build_user" == true ]]; then
|
|
echo "Building user docs (docs/user)..."
|
|
(
|
|
cd docs/user
|
|
npm run build
|
|
)
|
|
fi
|
|
|
|
if [[ "$build_developer" == true ]]; then
|
|
echo "Building developer docs (docs/developer)..."
|
|
(
|
|
cd docs/developer
|
|
npm run build
|
|
)
|
|
fi
|
|
|
|
echo "Docusaurus build check passed for changed docs site(s)."
|