Skip to content

tofuenv doesn't install in user prefixes #75

Description

@txomon

Describe the bug
I'm using tfenv as a user, all terraform versions being installed in ~/.tfenv/bin. It seems like tofuenv is not working as I expected it to.

To Reproduce
Steps to reproduce the behaviour:

  1. In a linux machine, using arch for example, install tofuenv through aur for example
  2. Try to install a version:
❯ tofuenv install 1.11.3
Installing OpenTofu v1.11.3
Downloading release tarball from https://github.com/opentofu/opentofu/releases/download/v1.11.3/tofu_1.11.3_linux_amd64.zip
Warning: The provided HTTP header '' does not look like a header?
######################################################################################################################################## 100.0%
Downloading SHA hash file from https://github.com/opentofu/opentofu/releases/download/v1.11.3/tofu_1.11.3_SHA256SUMS
Warning: The provided HTTP header '' does not look like a header?
mkdir: cannot create directory ‘/var/lib/tofuenv’: Permission denied
Failed to make directory /var/lib/tofuenv/versions/1.11.3

Expected behavior
I would expect tofuenv to install to my homedir.

Another way that should work theoretically
Steps to reproduce the behaviour:

  1. In a linux machine, using arch for example, install tofuenv through aur for example
  2. Try to install a version specifying what the tofuenv install dir should be:
❯ export TOFUENV_INSTALL_DIR=/home/user/.tofuenv/bin/
❯ mkdir -p $TOFUENV_INSTALL_DIR
❯ tofuenv install 1.11.3
Installing OpenTofu v1.11.3
Downloading release tarball from https://github.com/opentofu/opentofu/releases/download/v1.11.3/tofu_1.11.3_linux_amd64.zip
Warning: The provided HTTP header '' does not look like a header?
######################################################################################################################################## 100.0%
Downloading SHA hash file from https://github.com/opentofu/opentofu/releases/download/v1.11.3/tofu_1.11.3_SHA256SUMS
Warning: The provided HTTP header '' does not look like a header?
mkdir: cannot create directory ‘/var/lib/tofuenv’: Permission denied
Failed to make directory /var/lib/tofuenv/versions/1.11.3

Expected behaviour
I would expect tofuenv to install to ~/.tofuenv/bin

Environment (please complete the following information):

  • OS: linux
  • tofuenv version [e.g. 0.8.0]: 1.0.2-2 (from aur)

Additional context
I'm only filling this as a bug because tfenv works like this and I understood tofuenv wants to replicate the behaviour

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions