Skip to content

Commit 5779896

Browse files
authored
A convenience script for previewing docs changes. (#20569)
1 parent ca447cd commit 5779896

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+
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+
git diff --stat --exit-code > /dev/null || (echo "Expected clean git state in the pantsbuild/pantsbuild.org repo" && exit 1)
15+
16+
git checkout main
17+
18+
git apply --allow-empty "${DIFF_FILE}"
19+
20+
rm -f "${DIFF_FILE}"
21+
22+
npm start

0 commit comments

Comments
 (0)