Skip to content

Commit

Permalink
Merge pull request #14 from capralifecycle/improve-dev-scripts
Browse files Browse the repository at this point in the history
Improve dev scripts
  • Loading branch information
joakimen authored Jun 27, 2024
2 parents 0ce8f75 + b51044d commit f73ee09
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ node_modules/

.vscode/settings.json
.idea
.venv
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
VENV = .venv/bin
SCRIPTS = ./dev-scripts

.PHONY: all check venv update-docs

all: check

check:
npm install
$(SCRIPTS)/check-docs.sh
$(SCRIPTS)/lint-modified-shell-scripts.sh

venv:
python -m venv .venv; \
$(VENV)/pip install -r requirements.txt

update-docs:
$(SCRIPTS)/update-docs.sh
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
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PyYAML==6.0.1

0 comments on commit f73ee09

Please sign in to comment.