mirror of
https://github.com/tofuutils/pre-commit-opentofu.git
synced 2026-06-14 20:46:55 +02:00
Merge pull request #79 from RoseSecurity/fix-bash-incompatibility-errors
fix(hooks): Make env var regex portable
This commit is contained in:
commit
cc0381b3f8
1 changed files with 1 additions and 1 deletions
|
|
@ -112,7 +112,7 @@ function common::parse_and_export_env_vars {
|
|||
while true; do
|
||||
# Check if at least 1 env var exists in `$arg`
|
||||
# shellcheck disable=SC2016 # '${' should not be expanded
|
||||
if [[ "$arg" =~ .*'${'[A-Z_][A-Z0-9_]*'}'.* ]]; then
|
||||
if [[ "$arg" =~ '${'[A-Z_][A-Za-z0-9_]*'}' ]]; then
|
||||
# Get `ENV_VAR` from `.*${ENV_VAR}.*`
|
||||
local env_var_name=${arg#*$\{}
|
||||
env_var_name=${env_var_name%%\}*}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue