inclusive-design-checklist icon indicating copy to clipboard operation
inclusive-design-checklist copied to clipboard

Implement pre-commit hook for generator

Open Andy-set-studio opened this issue 7 years ago • 2 comments

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

Andy-set-studio avatar Dec 02 '17 21:12 Andy-set-studio

@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.)

Heydon avatar Dec 28 '17 14:12 Heydon

Yeh I spotted that. Looks good mate 👍🏼

Andy-set-studio avatar Dec 28 '17 14:12 Andy-set-studio