Skip to content

Commit 561df88

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

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

build-support/preview_docs.sh

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

0 commit comments

Comments
 (0)