Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

g-script/auto-husky

Repository files navigation

auto-husky

Installing husky made easy as woof! 🐶

oclif Version Downloads/week License

📑 Table of contents

💾Installation

You can install the package globally if you need it regularly:

$ npm install -g auto-husky

Or you can run it directly with npx:

$ npx auto-husky

🔰 Usage

This package can be used in fully interactive mode or by specifying some options.

There is only one argument to provide: WORKINGDIRECTORY. This is the directory where command will be executed, it should point to the directory under which .git folder is located. It defaults to current working directory, and supports relative paths.

There is also a few flags available:

--interactive (-i)

Turn on interactive mode.

This option will interactively ask you questions matching following flags. You can preset all answers through matching flags, but only boolean flags will not be asked again.

--destination (-d)

Set a custom installation directory for husky.

This should point to the directory where your package.json file is located. It defaults to working directory and must be set as relative to it.

--[no-]yarn2

Setup husky for yarn 2. It will use postinstall script rather than prepare script, which is not supported by yarn 2.

--[no-]pinst (-p)

Install and setup pinst.

This option will add two scripts (prepublishOnly and postpublish) that will disable postinstall script when publishing your package to a registry.

This is only useful for yarn 2 projects! It is not needed with npm or yarn because they do not use postinstall script to automatically install husky.

--[no-]fix-gitkraken (-g)

Automatically apply compatibility fix for Gitkraken.

Examples:

# Most common usage
$ auto-husky

# Fully interactive usage
$ auto-husky -i

# Preset some answers for interactive mode
$ auto-husky -i --no-pinst

# Usage with custom folder
$ auto-husky -d ./custom-folder

🔢 Versioning

This project uses SemVer for versioning. For the versions available, see the tags on this repository.

About

Installing husky made easy as woof!

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages