@bbortt/owl-autoinstall v1.0.0-1
🦉 OWL
GIT hooks made easy.
+ Written in pure JS. \ + Configuration as code: Stored in readable JSON format. \ + MIT Licensed.
Table Of Contents
Installation
Once downloaded you need to initialize the hook and create a configuration. Follow the steps below, and you will be good to go in seconds!
Scripts
Automated
Add @bbortt/owl and @bbortt/owl-autoinstall at the same time. The postinstall script in the second package will
take care of installing the scripts in .owl.
Manual
Add @bbortt/owl via npm or yarn and execute the installation command in order to set up the hooks:
owl installInitialization
You can create a compatible rc file by hand or via owl init (see the documentation). Add hooks using
the owl add command (help for help), or by hand too. Example:
owl add pre-commit "npx pretty-quick --staged"Take a look at configuration files or the CLI documentation for more information.
Configuration Files
In order to support multiple commands in the same hook this project reads configuration
via cosmiconfig. Valid files are for example package.json
, .owlrc.json or other compatible rc files. \
This does make it possible to configure hooks without using the CLI
too. An example .owlrc.json:
{
"hooks": {
"pre-commit": ["npx pretty-quick --staged"]
}
}Supported Hooks
pre-commit
More to come in #1.
CLI
The following commands are executable through the cli owl:
install
Signature: owl install [folder].
Installs the binary into .owl. Careful: Do not manually update the generated files. They will be overwritten by
any subsequent calls of this command (for example in a postinstall script).
init
Signature: owl add init.
Initializes a configuration file called .owlrc.json in the root directory. It does not contain any hooks.
add
Signature: owl add [HOOK-TYPE] [HOOK].
Adds a hook by type into any found configuration file. E.g.
the .owlrc.json was completed
using owl add pre-commit "ngx pretty-quick --staged". \
Supported hooks are: pre-commit .
How Does It Work?
It really is no magic! To be documented.
License
This project is licensed under the terms of the MIT license.