Skip to content

Commit

Permalink
docs: explain run details
Browse files Browse the repository at this point in the history
  • Loading branch information
mrexox committed Dec 21, 2024
1 parent 36a39d2 commit b736c65
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/mdbook/configuration/run.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
## `run`

> **Note:** `run` command is treated differently on Unix-like systems (macOS, Linux) and Windows:
>
> - ***nix**: commands get wrapped with `sh -c '<run>'`
> - **Windows**: commands execute natively
>
> So, when on *nix systems you can use pipes, builtins of a Bourne Shell, etc. For Windows the capabilities are limited by a single command.
This is a mandatory option for a command. This is actually a command that is executed for the hook.

You can use files templates that will be substituted with the appropriate files on execution:
Expand All @@ -12,6 +19,8 @@ You can use files templates that will be substituted with the appropriate files
- `{0}` - shorthand for the single space-joint string of git hook arguments.
- `{N}` - shorthand for the N-th git hook argument.

> **Note:** Command line length has a limit on every system. If your list of files is quite long, lefthook splits your files list to fit in the limit and runs few commands sequentially.
**Example**

Run `yarn lint` on `pre-commit` hook.
Expand Down

0 comments on commit b736c65

Please sign in to comment.