Skip to content

Commit 46de20e

Browse files
bicarlsenctron
authored andcommitted
Adds hook override explanation to guide.
1 parent 44d2698 commit 46de20e

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

guide/src/build/hooks.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,14 @@ the following environment variables are provided to the process:
4444
- `TRUNK_STAGING_DIR`: the full path of the Trunk staging directory.
4545
- `TRUNK_DIST_DIR`: the full path of the Trunk dist directory.
4646
- `TRUNK_PUBLIC_URL`: the configured public URL for Trunk.
47+
48+
## OS-specific overrides
49+
50+
Often times you will want to perform the same build step on different OSes, requiring different commands.
51+
A typical example of this is using the `sh` command on Linux, but `cmd` on Windows.
52+
To accomodate this, you can optionally create OS-specific overrides for each hook.
53+
To do this, specify the default hook, then directly below it create a `[hooks.<os>]` entry where `<os>`
54+
can be one of `windows`, `macos`, or `linux`. Within this entry you must specify only the `command` and
55+
`command_argumnets` keys. You may provide multiple overrides for each hook. i.e.
56+
One for `windows`, one for `macos`, and one for `linux`.
57+

site/content/assets.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,13 @@ All hooks are executed using the same `stdin` and `stdout` as trunk. The executa
185185

186186
## OS-specific overrides
187187

188-
Often times you will want to perform the same build step on different OSes, requiring different commands. A typical example of this is using the `sh` command on Linux, but `cmd` on Windows. To accomodate this, you can optionally create OS-specific overrides for each hook. To do this, specify the default hook, then directly below it create a `[hooks.<os>]` entry where `<os>` can be one of `windows`, `macos`, or `linux`. Within this entry you must specify only the `command` and `command_argumnets` keys. You may provide multiple overrides for each hook. i.e. One for `windows`, one for `macos`, and one for `linux`.
188+
Often times you will want to perform the same build step on different OSes, requiring different commands.
189+
A typical example of this is using the `sh` command on Linux, but `cmd` on Windows.
190+
To accomodate this, you can optionally create OS-specific overrides for each hook.
191+
To do this, specify the default hook, then directly below it create a `[hooks.<os>]` entry where `<os>`
192+
can be one of `windows`, `macos`, or `linux`. Within this entry you must specify only the `command` and
193+
`command_argumnets` keys. You may provide multiple overrides for each hook. i.e.
194+
One for `windows`, one for `macos`, and one for `linux`.
189195

190196
# Auto-Reload
191197

0 commit comments

Comments
 (0)