Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: name field for exec blocks #55

Open
korenyoni opened this issue Jul 7, 2022 · 0 comments
Open

Feature request: name field for exec blocks #55

korenyoni opened this issue Jul 7, 2022 · 0 comments

Comments

@korenyoni
Copy link

A name field for an exec block would be helpful in cleaning up output when a non-exit zero code is intentional.

For example:

➜  my-cli component init eks/irsa/external-dns .                                       
Component . already initialized
Error: command "bash -c     if [[ -d . ]] && [[ "false" == "false" ]]; then
      echo "Component . already initialized"
      exit 1
    fi

    if [[ -d /Users/yonatankoren/software/example/terragrunt/_components/eks/irsa/external-dns ]]; then
      mkdir -p .
      cat /Users/yonatankoren/software/software/example/terragrunt/_components/eks/irsa/external-dns/terragrunt.hcl | sed "s!COMPONENT!eks/irsa/external-dns!g" > ./terragrunt.hcl # use delimiter other than / (which exists in component names)
    else
      echo "Error: component does not exist"
      exit 1
    fi
": exit status 1

If the exec block accepted a name, it could look something like this:

exec {
    name = "init-component"
    command = "bash"
    ...

Then when a non-exit zero code occurs, only the name is reported and not the whole command:

Component . already initialized
Error: init-component: exit status 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant