inclusive-design-checklist
inclusive-design-checklist copied to clipboard
Implement pre-commit hook for generator
I’ve pulled this discussion here to keep things focused.
We discussed as part of the generator that converts “checklist.json” into “README.md” that we should make a pre-commit hook that would automatically run the generator for us. (See #1 & #22)
The script
I’ve already put a little idea together for the script, which I’ve already pasted into #1. Here it is for reference:
#!/bin/sh
# Check if this is the initial commit
if git rev-parse --verify HEAD >/dev/null 2>&1
then
node generator/index.js
git add README.md
exit 0
else
exit 0
I guess we need to think of a solution that doesn’t over complicate things for a potential contributor.
@peter-mouland has already kicked the ideas off in #1 by suggesting husky
@hankchizljaw I've compacted the reference links (also added a few more, but they don't all have one yet and only one has two.)
Yeh I spotted that. Looks good mate 👍🏼