From b736c65541f4955da4f932b0f8a2d8c1c4ba9b22 Mon Sep 17 00:00:00 2001 From: Valentin Kiselev Date: Sat, 21 Dec 2024 11:20:22 +0300 Subject: [PATCH] docs: explain run details --- docs/mdbook/configuration/run.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/mdbook/configuration/run.md b/docs/mdbook/configuration/run.md index 06100419..8d78148c 100644 --- a/docs/mdbook/configuration/run.md +++ b/docs/mdbook/configuration/run.md @@ -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 ''` +> - **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: @@ -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.