cunymatthieu / tgenv

Terragrunt version manager
MIT License
223 stars 70 forks source link

Fix: delete version folder on curl fail #37

Closed tomer-landesman closed 2 years ago

tomer-landesman commented 2 years ago

The Issue

for some reason, command tgenv-install sometimes fails on curl command, resulting in Tarball download failed. although the operation failed, the terragrunt folder inside versions is still created, therefore causing a bug when trying to retry the tgenv-install command.

The Fix

added a check after CURL to check exit status (assuming it was not 0 when failed) if its not 0 - remove terragrunt folder so that we can retry the command again.