Skip to content

Latest commit

 

History

History
170 lines (114 loc) · 4.54 KB

install.md

File metadata and controls

170 lines (114 loc) · 4.54 KB

Install lefthook

Choose your fighter:


Ruby

gem install lefthook

Troubleshooting

If you see the error lefthook: command not found you need to check your $PATH. Also try to restart your terminal.

Node.js

Lefthook is available on NPM in the following flavors:

  1. lefthook that will install the proper binary:

    npm install lefthook --save-dev
    # or yarn:
    yarn add -D lefthook
  2. @evilmartians/lefthook with pre-bundled binaries for all architectures:

    npm install @evilmartians/lefthook --save-dev
    # or yarn:
    yarn add -D @evilmartians/lefthook
  3. @evilmartians/lefthook-installer that will fetch binary file on installation:

    npm install @evilmartians/lefthook-installer --save-dev
    # or yarn:
    yarn add -D @evilmartians/lefthook-installer

Note

If you use pnpm package manager make sure you set side-effects-cache = false in your .npmrc, otherwise the postinstall script of the lefthook package won't be executed and hooks won't be installed.

Go

go install github.com/evilmartians/lefthook@latest

Python

python -m pip install --user lefthook

Swift

You can find the Swift wrapper plugin here.

Utilize lefthook in your Swift project using Swift Package Manager:

.package(url: "https://github.com/csjones/lefthook-plugin.git", exact: "1.8.1"),

Or, with mint:

mint run csjones/lefthook-plugin

Scoop for Windowss

scoop install lefthook

Homebrew for MacOS and Linux

brew install lefthook

Winget for Windows

winget install evilmartians.lefthook

Snap for Linux

snap install --classic lefthook

APT packages for Debian/Ubuntu Linux

curl -1sLf 'https://dl.cloudsmith.io/public/evilmartians/lefthook/setup.deb.sh' | sudo -E bash
sudo apt install lefthook

See all instructions: https://cloudsmith.io/~evilmartians/repos/lefthook/setup/#formats-deb

Hosted By: Cloudsmith

RPM packages for CentOS/Fedora Linux

curl -1sLf 'https://dl.cloudsmith.io/public/evilmartians/lefthook/setup.rpm.sh' | sudo -E bash
sudo yum install lefthook

See all instructions: https://cloudsmith.io/~evilmartians/repos/lefthook/setup/#repository-setup-yum

Hosted By: Cloudsmith

APK packages for Alpine

sudo apk add --no-cache bash curl
curl -1sLf 'https://dl.cloudsmith.io/public/evilmartians/lefthook/setup.alpine.sh' | sudo -E bash
sudo apk add lefthook

See all instructions: https://cloudsmith.io/~evilmartians/repos/lefthook/setup/#formats-alpine

Hosted By: Cloudsmith

AUR for Arch

You can install lefthook package from AUR.

yay -S lefthook

Manuall installation with prebuilt executable

Or take it from binaries and install manually.

  1. Download the executable for your OS and Arch
  2. Put the executable under the $PATH (for unix systems)

More info

Have a question?

🤔 Start a discussion