tests/utils/env.sh.in: add comments and remove redundancy
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 9 Nov 2023 16:43:10 +0000 (11:43 -0500)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 7 Feb 2024 21:25:56 +0000 (16:25 -0500)
commit2a656b4ae7df23627559ac7e891ff3d419c71ef6
tree8f76c6923c25bdf732970d0ee1125b8dcc53dbff
parentb939afe57d2f5911460fab65e334b789d2a96bd5
tests/utils/env.sh.in: add comments and remove redundancy

This patch removes redundancy in `env.sh.in` 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 at the end to avoid polluting the scope of
whatever sources `env.sh`.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: If392a6513b04b9e5fc2fd7b010b4071369e05b07
tests/utils/env.sh.in
This page took 0.024682 seconds and 4 git commands to generate.