MicahElliott / captain

A simpler approach to git-hook management
Other
2 stars 0 forks source link

Generate a new user setup/init #6

Open MicahElliott opened 11 months ago

MicahElliott commented 11 months ago

Offer a capt setup command. Or is capt init better?

This should possibly be interactive, since some of the steps should be optional (setting hooksPath).

First check if it's a clone that has all the utils available (vs just a wget of capt).

For new users, to a proj that already has captain_

Simply create the git config core.hooksPath .capt/hooks setup, after checking that they're in the right place and that the .capt dir is there.

For brand new virgin projects

Create the .capt dir and its subdirs (based on for-loop in readme), and also point hooksPath (as above). Could also create shared.sh and local.sh with some of the generic checkers enabled and all the arrays laid out.

Generate a starter share.sh file with a few common triggers active, and local that just contains colorquote to suggest that this is a good place to dive in whenever you want to customize git hooking.

Generate a .gitmessage file with message template and guidelines/advice. And set git config commit.template .gitmessage (which seems to play nice with the git-prepare-msg hook.

Add local.sh to .gitignore.

Should be smart about not creating any piece of this that already exists.