From 2fb860e6c1cf73c4eac77e7baa4b4e3da772c974 Mon Sep 17 00:00:00 2001 From: Eino Rauhala <60004820+EinoHR@users.noreply.github.com> Date: Thu, 11 May 2023 16:57:00 +0300 Subject: [PATCH] docs: fix: clarity and grammar updates for scripts docs --- scripts/README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/README.md b/scripts/README.md index f26e11bd7c..6c434a1faf 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -2,22 +2,22 @@ You can add custom scripts to this directory and declare them to be run at build time in the `scripts:` section of `recipe.yml`. Custom scripts can be run at either the `pre:` execution phase right after the custom repositories are added, or at the `post:` phase after all of the automatic build steps. -Your scripts will be given exactly one argument when they are executed, which specifies its precise execution phase (`pre` or `post`). The primary purpose of this argument is to streamline the reuse of scripts for multiple stages. This behavior is mirrored both in manually declared scripts and scripts ran by `autorun.sh`. +Your scripts will be given exactly one argument when they are executed, which specifies its precise execution phase (`pre` or `post`). The primary purpose of this argument is to streamline the reuse of scripts for multiple stages. This argument is provided for both manually declared scripts and scripts ran by `autorun.sh`. ## Creating a script Look at `example.sh` for an example shell script. You can rename and copy the file for your own purposes. In order for the script to be executed, either move it to `scripts/pre/` or `scripts/post/` (if using `autorun.sh`) or declare it in the `recipe.yml`. -All commands from programs installed as rpms should be available when running the script at the `post` execution phase. +All commands from RPMs you've declared in the `recipe.yml` should be available when running scripts at the `post` execution phase. -When creating a script from make sure +When creating a script, please make sure -- its filename ends with `.sh` - - Follows convention for (especially bash) shell scripts - - `autorun.sh` only executes files that match `*.sh` -- it starts with a [shebang]() like `#!/usr/bin/env bash` - - Ensures the script is ran with the correct interpreter / shell -- it contains the command `set -oue pipefail` near the start +- ...its filename ends with `.sh`. + - This follows convention for (especially bash) shell scripts. + - `autorun.sh` only executes files that match `*.sh`. +- ...it starts with a [shebang]() like `#!/usr/bin/env bash`. + - This ensures the script is ran with the correct interpreter / shell. +- ...it contains the command `set -oue pipefail` near the start. - This will make the image build fail if your script fails. If you do not care if your script works or not, you can omit this line. ## `autorun.sh`