Skip to content

Commit 125b94a

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

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

build-support/preview_docs.sh

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
DIFF_FILE=$(mktemp)
9+
10+
git diff main docs/ > "${DIFF_FILE}"
11+
12+
cd ../pantsbuild.org
13+
14+
if [[ $(git diff --stat) != '' ]]; then
15+
echo "Expected clean git state in the pantsbuild/pantsbuild.org repo"
16+
exit 1
17+
fi
18+
19+
git checkout main
20+
21+
git apply --allow-empty "${DIFF_FILE}"
22+
23+
rm -f "${DIFF_FILE}"
24+
25+
npm start

0 commit comments

Comments
 (0)