tests/utils/utils.sh: remove redundancy when setting def. var. values
This patch removes more redundancy in `utils.sh` by using a function
which sets a variable by name if it's empty and exports it.
This makes the file less error-prone: the variable name is written just
once, making it safer to add more.
The
export "${varname?}"
form is to make ShellCheck happy, even if a simple `export $varname`
would perfectly work in this context.
The function is unset when it's not needed anymore to avoid polluting
the scope of whatever sources `utils.sh`.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I6e25aa557f4d09f8129121b76b8b3a860ba3ed29
This page took 0.030229 seconds and 4 git commands to generate.