Add env vars usage idiom for writing types

remotes/origin/shellcheck
Darko Poljak 7 years ago
parent 2f20b31758
commit 58b0e83655
  1. 13
      docs/src/cdist-type.rst

@ -331,6 +331,19 @@ So when you generate a script with the following content, it will work:
fi
Environment variable usage idiom
--------------------------------
In type scripts you can support environment variables with default values if
environment variable is unset or null by using **${parameter:-[word]}**
parameter expansion.
Example using mktemp in a portable way that supports TMPDIR environment variable.
.. code-block:: sh
tempfile=$(mktemp "${TMPDIR:-/tmp}/cdist.XXXXXXXXXX")
Log level in types
------------------
cdist log level can be accessed from __cdist_log_level variable.One of:

Loading…
Cancel
Save