busser / tfautomv

Generate Terraform moved blocks automatically for painless refactoring
https://github.com/busser/tfautomv
Apache License 2.0
705 stars 23 forks source link

Ignoring -terraform-bin parameter when running with -output=commands #70

Closed p1gmale0n closed 9 months ago

p1gmale0n commented 11 months ago

When executing the command with the parameter -output=commands, it appears that the -terraform-bin parameter is being ignored.

example:

> tfautomv -terraform-bin=terragrunt --dry-run
Running "terraform init"...
Running "terraform plan"...
╷
│ Moves
│ ╷
│ │ From: random_pet.dog
│ │ To:   random_pet.cat
│ ╵
╵
> tfautomv -terraform-bin=terragrunt -output=commands
Running "terraform init"...
Running "terraform plan"...
terraform state mv "random_pet.dog" "random_pet.cat"
> tfautomv --version
v0.5.4
busser commented 10 months ago

This isn't something I anticipated, and I agree with you that what the -output=commands flag should respect the -terraform-bin flag. Thanks for reporting it!

strowi commented 9 months ago

Thx, was banging my head wondering why it didn't work (just starting to test tfautomv). Just stumbled into the same problem, tfautomv --terraform-bin=terragrunt --output=commands --skip-init shows only the moves, not the commands.

busser commented 9 months ago

This is fixed in v0.6.2 🙂. Thanks again for reporting this bug!