Debian Codegraph @

ansible_collections/vmware/vmware_rest/tests/integration/generate_integration_config.sh

raw
1 #!/usr/bin/env bash
2 # shellcheck disable=SC2155,SC2086
3
4 # Resolve the script's directory reliably
5 SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)"
6 cd "$SCRIPT_DIR" || exit 1
7
8 # Truncate the output file
9 truncate -s 0 "${SCRIPT_DIR}/integration_config.yml"
10
11 # Read the template and substitute environment variables
12 while read -r line; do
13 eval 'echo "'"$line"'"' >> "${SCRIPT_DIR}/integration_config.yml"
14 done < "${SCRIPT_DIR}/integration_config.yml.tpl"