Skip to content

Commit

Permalink
A convenience script for previewing docs changes. (#20569)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjyw authored Feb 17, 2024
1 parent ca447cd commit 5779896
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions build-support/preview_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

set -euo pipefail

# Expects a sibling dir called "pantsbuild.org" containing a clean clone
# of the https://github.com/pantsbuild/pantsbuild.org repo.

DIFF_FILE=$(mktemp)

git diff main docs/ > "${DIFF_FILE}"

cd ../pantsbuild.org

git diff --stat --exit-code > /dev/null || (echo "Expected clean git state in the pantsbuild/pantsbuild.org repo" && exit 1)

git checkout main

git apply --allow-empty "${DIFF_FILE}"

rm -f "${DIFF_FILE}"

npm start

0 comments on commit 5779896

Please sign in to comment.