Skip to content

Commit

Permalink
feat: add dev script update-docs.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
joakimen committed Jun 26, 2024
1 parent 431cab0 commit a9f3fd4
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions dev-scripts/update-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -euo pipefail

script_dir="$(dirname "${BASH_SOURCE[0]}")"
cd "$script_dir/.." || exit

PYTHON=".venv/bin/python"

if ! command -v $PYTHON &> /dev/null; then
echo "Python virtual environment not found. See Makefile for setup instructions."
exit 1
fi

updated_readme=$($PYTHON generate-docs.py README.md)

if [ "$updated_readme" = "" ]; then
echo "Updated README is empty, will not overwrite."
exit 1
fi

echo "$updated_readme" > README.md
git diff README.md

0 comments on commit a9f3fd4

Please sign in to comment.