Skip to content

Feature request: name field for exec blocks #55

Description

@korenyoni

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions