tfutils / tfenv

Terraform version manager
MIT License
4.48k stars 454 forks source link

Can't install tfenv on Windows with username having space " " in between. #330

Open ibatulanandjp opened 2 years ago

ibatulanandjp commented 2 years ago

Platform: Windows 10

Installation CLI: Git Bash

Issue: Can't install tfenv on Windows with username having blank spaces in between.

Error:

Atul Anand@DESKTOP-0XXXX0X MINGW64 ~
$ tfenv -v
/c/Users/Atul Anand/.tfenv/bin/tfenv: line 20: cd: $'/c/Users\nAnand/.tfenv/bin': No such file or directory
[FATAL] /c/Users/Atul Anand/.tfenv/bin/tfenv: Failed to 'cd $(dirname /c/Users/Atul Anand/.tfenv/bin/tfenv)' while trying to determine TFENV_ROOT
/c/Users/Atul Anand/.tfenv/bin/tfenv: line 39: /c/Users/lib/helpers.sh: No such file or directory
[FATAL] /c/Users/Atul Anand/.tfenv/bin/tfenv: Failed to source helpers from /c/Users/lib/helpers.sh

It's evident from the error that the path to the bin was not correctly taken by the code on Line 20.

I tried to create a new Windows user with the username "Atul" (Without spaces) And, as a result, the installation was successful. Refer to the screenshot below. tfenv Successful Installation Screenshot  Atul _LI

I wonder if there is any special way to handle this. If not, this might be a bug that needs to be fixed. Please let me know if anybody knows the answer to this problem.

Zordrak commented 2 years ago

Quotes have been added around some variable expansions.. can you retest with master?

If you still experience this issue can you provide log output with TFENV_DEBUG=1

gruckion commented 1 year ago

@ibatulanandjp did you retest so we can close this ticket off?