tofuutils / tenv

OpenTofu / Terraform / Terragrunt and Atmos version manager
https://tofuutils.github.io/tenv/
Apache License 2.0
662 stars 32 forks source link

tenv Terragrunt on Windows - missing .exe extension #162

Closed silic2020 closed 3 months ago

silic2020 commented 3 months ago

Describe the bug Tenv Terragrunt installed with chocolatey does not work on Windows. To resolve, you have to rename yourself the executable file , by adding the .exe.

To Reproduce Steps to reproduce the behavior:

  1. install tenv with chocolatey : choco install tenv
  2. install Terragrunt last version : tenv tg install
  3. try to use Terragrunt : Terragrunt init
  4. You'll get this error : Failure during terragrunt call : exec: "C:\Users\xxxxxx\.tenv\Terragrunt\0.58.14\terragrunt": file does not exist

Additional context Open the executable file location (here in folder C:\Users\xxxxxx.tenv\Terragrunt\0.58.14). Rename terragrunt by terragrunt.exe , terragrunt will work fine now

kvendingoldo commented 3 months ago

we'll fix it soon, that you for reporting

kvendingoldo commented 3 months ago

hmm, that's strange, I see that we add extension here https://github.com/tofuutils/tenv/blob/2e22c969419e6134adf691d0a37656a549dbdff7/versionmanager/retriever/terragrunt/terragruntretriever.go#L146 we'll continue to investigate it

kvendingoldo commented 3 months ago

Looks like that I found the issue: https://github.com/tofuutils/tenv/blob/main/config/config.go#L39

I think that here we have to change return based on runtime.GOOS https://github.com/tofuutils/tenv/blob/2e22c969419e6134adf691d0a37656a549dbdff7/versionmanager/retriever/terragrunt/terragruntretriever.go#L110C55-L110C69

kvendingoldo commented 3 months ago

@silic2020 may I ask you to try version 2.0.4 when it will be available at choco, please?

silic2020 commented 3 months ago

@silic2020 may I ask you to try version 2.0.4 when it will be available at choco, please?

@kvendingoldo I've tried with the latest version 2.0.5. The error is the same : "file does not exist". The file extension ".exe" is now present, but the terragrunt file is incorrectly named. Instead of having "terragrunt.exe" I get "terragrunt_windows_amd64.exe"

kvendingoldo commented 3 months ago

got it, will fix it today.

kvendingoldo commented 3 months ago

https://github.com/tofuutils/tenv/pull/168 @silic2020 can you check the version 2.0.6, please?

dvaumoron commented 3 months ago

v2.0.7 work on Windows (I tested on a x86_64)

silic2020 commented 3 months ago

also tested with v.20.7, thks it works great!