mirror of
https://github.com/tofuutils/pre-commit-opentofu.git
synced 2025-10-15 17:38:54 +02:00
fix: Add --env-vars, deprecate --envs (#410)
This commit is contained in:
parent
b12f0c662c
commit
2b35cad50f
15 changed files with 24 additions and 22 deletions
|
|
@ -26,7 +26,7 @@ function common::initialize {
|
|||
# ARGS (array) arguments that configure wrapped tool behavior
|
||||
# HOOK_CONFIG (array) arguments that configure hook behavior
|
||||
# TF_INIT_ARGS (array) arguments for `terraform init` command
|
||||
# ENVS (array) environment variables will be available
|
||||
# ENV_VARS (array) environment variables will be available
|
||||
# for all 3rd-party tools executed by a hook.
|
||||
# FILES (array) filenames to check
|
||||
# Arguments:
|
||||
|
|
@ -40,10 +40,11 @@ function common::parse_cmdline {
|
|||
# Used inside `common::terraform_init` function
|
||||
TF_INIT_ARGS=()
|
||||
# Used inside `common::export_provided_env_vars` function
|
||||
ENVS=()
|
||||
ENV_VARS=()
|
||||
|
||||
local argv
|
||||
argv=$(getopt -o a:,h:,i:,e: --long args:,hook-config:,init-args:,tf-init-args:,envs: -- "$@") || return
|
||||
# TODO: Planned breaking change: remove `init-args`, `envs` as not self-descriptive
|
||||
argv=$(getopt -o a:,h:,i:,e: --long args:,hook-config:,init-args:,tf-init-args:,envs:,env-vars: -- "$@") || return
|
||||
eval "set -- $argv"
|
||||
|
||||
for argv; do
|
||||
|
|
@ -64,9 +65,10 @@ function common::parse_cmdline {
|
|||
TF_INIT_ARGS+=("$1")
|
||||
shift
|
||||
;;
|
||||
-e | --envs)
|
||||
# TODO: Planned breaking change: remove `--envs` as not self-descriptive
|
||||
-e | --envs | --env-vars)
|
||||
shift
|
||||
ENVS+=("$1")
|
||||
ENV_VARS+=("$1")
|
||||
shift
|
||||
;;
|
||||
--)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue