I am using Terraform for a project and I got two tasks in my package.json
to launch terraform plan
and terraform apply
.
"scripts": {
"tf:apply": "terraform apply",
"tf:plan": "terraform plan"
}
For both of these commands, I need to perform a terraform get
first. I would like to have just one pretask
for both of them.
I tried to use:
"scripts": {
"pretf:*": "terraform get",
"tf:apply": "terraform apply",
"tf:plan": "terraform plan"
}
But it doesn't work.
Is there any way to achieve this using NPM
or Yarn
only ? Or am I forced to write the exact same pretask for both of these tasks ?