Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create new symlink #76

Open
jimsmith opened this issue Jun 16, 2020 · 1 comment
Open

Unable to create new symlink #76

jimsmith opened this issue Jun 16, 2020 · 1 comment

Comments

@jimsmith
Copy link

 tgswitch -v

Version: 0.4.326
cat .tgswitchrc
0.23.8
cd infrastructure-live/
Reading required terragrunt version .tgswitchrc
2020/06/16 11:21:18
		Unable to create new symlink.
		Maybe symlink already exist. Try removing existing symlink manually.
		Try running "unlink" to remove existing symlink.
		If error persist, you may not have the permission to create a symlink at /Users/jim/bin.
		Error: symlink /Users/jim/.terragrunt.versions/terragrunt_0.23.8 /Users/jim/bin: file exists


ls -la /Users/jim/bin/
total 0
drwxr-xr-x   3 jim  staff    96 16 Jun 11:21 .
drwxr-xr-x+ 65 jim  staff  2080 16 Jun 11:13 ..
lrwxr-xr-x   1 jim  staff    50 16 Jun 09:40 terraform -> /Users/jim/.terraform.versions/terraform_0.12.24

ls -ls /Users/jim/.terragrunt.versions/
total 63496
63496 -rwxr-xr-x  1 jim  staff  32270640 16 Jun 11:23 terragrunt_0.23.8

Workaround for me is to add -b $HOME/bin/terragrunt notice I added terragrunt so the documentation might be outdated ?

cdtgswitch(){
  builtin cd "$@";
  cdir=$PWD;
  if [ -f "$cdir/.tgswitchrc" ]; then
    tgswitch -b $HOME/bin/terragrunt
  fi
}
alias cd='cdtgswitch'

Showing it working when adding above workaround:

cd infrastructure-live/
Reading required terragrunt version .tgswitchrc
Switched terragrunt to version "0.23.8"
$ which terragrunt && terragrunt --version
/Users/jim/bin/terragrunt
terragrunt version v0.23.8
@CarterSheehan
Copy link

The workaround above works for me.

The troubleshooting documentation should be updated once this is fixed, sudo privs shouldn't be required for this..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants