From 41c7eb70780cfd328025f71373b07d5bf64d96ce Mon Sep 17 00:00:00 2001 From: apainintheneck Date: Sat, 13 May 2023 23:39:27 -0700 Subject: [PATCH] formula-cookbook: update service docs Add more info about the `run` method. - Adds array example - Adds OS specific example --- docs/Formula-Cookbook.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/Formula-Cookbook.md b/docs/Formula-Cookbook.md index e4e3743bb1..d1667f79b2 100644 --- a/docs/Formula-Cookbook.md +++ b/docs/Formula-Cookbook.md @@ -881,9 +881,21 @@ There are two ways to add `launchd` plists and `systemd` services to a formula, 2. If the formula does not provide a service file you can generate one using the following stanza: ```ruby + # 1. An individual command service do run opt_bin/"script" end + + # 2. A command with arguments + service do + run [opt_bin/"script", "--config", etc/"dir/config.yml"] + end + + # 3. OS specific commands (If you omit one, the service file won't get generated for that OS.) + service do + run macos: [opt_bin/"macos_script", "standalone"], + linux: var/"special_linux_script" + end ``` #### Service block methods