Skip to content

Commit 08a6155

Browse files
committed
A convenience script for previewing docs changes.
1 parent 3c940a9 commit 08a6155

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

build-support/preview_docs.sh

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
set +x
5+
6+
# Expects a sibling dir called "pantsbuild.org" containing a clean clone
7+
# of the https://github.com/pantsbuild/pantsbuild.org repo.
8+
9+
TMPDIR=$(mktemp -d)
10+
git diff main docs/ > "${TMPDIR}/diff"
11+
cd ../pantsbuild.org
12+
13+
if [[ $(git diff --stat) != '' ]]; then
14+
echo "Expected clean git state in the pantsbuild/pantsbuild.org repo"
15+
exit 1
16+
fi
17+
18+
git checkout main
19+
20+
git apply --allow-empty "${TMPDIR}/diff"
21+
22+
npm start

0 commit comments

Comments
 (0)