Skip to content

Commit

Permalink
feat: rename gotofuenv to tenv
Browse files Browse the repository at this point in the history
  • Loading branch information
kvendingoldo committed Jan 23, 2024
1 parent b0f781d commit 0224299
Show file tree
Hide file tree
Showing 22 changed files with 66 additions and 66 deletions.
10 changes: 5 additions & 5 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

project_name: gotofuenv
project_name: tenv
version: 1

before:
Expand Down Expand Up @@ -86,9 +86,9 @@ archives:
nfpms:
- file_name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Arch }}'
maintainer: 'https://github.com/dvaumoron'
homepage: https://github.com/tofuutils/gotofuenv
homepage: https://github.com/tofuutils/tenv
description: >-
GoTofuEnv help manage several version of OpenTofu (https://opentofu.org) and Terraform (https://www.terraform.io/),
tenv help manage several version of OpenTofu (https://opentofu.org) and Terraform (https://www.terraform.io/),
tenv is the managing command and tofu and terraform are proxy commands.
license: "Apache-2.0"
formats:
Expand All @@ -99,7 +99,7 @@ nfpms:
section: default
contents:
- src: ./LICENSE
dst: /usr/share/doc/gotofuenv/copyright
dst: /usr/share/doc/tenv/copyright
file_info:
mode: 0444
rpm:
Expand All @@ -114,7 +114,7 @@ brews:
owner: tofuutils
name: homebrew-tap
folder: Formula
homepage: https://github.com/tofuutils/gotofuenv
homepage: https://github.com/tofuutils/tenv
description: OpenTofu and Terraform version manager (inspired by tofuenv, written in Go)
license: "Apache-2.0"
commit_msg_template: "Brew formula update for {{ .ProjectName }} version {{ .Tag }}"
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Install via [Homebrew](https://brew.sh/)

```console
brew tap tofuutils/tap
brew install gotofuenv
brew install tenv
```

You can enable cosign check with :
Expand All @@ -31,7 +31,7 @@ brew install cosign

### Manual

Get the last packaged binaries (use .deb, .rpm, .apk or .zip) found [here](https://github.com/tofuutils/gotofuenv/releases).
Get the last packaged binaries (use .deb, .rpm, .apk or .zip) found [here](https://github.com/tofuutils/tenv/releases).

For the .zip case, the unzipped folder must be added to your PATH.

Expand Down Expand Up @@ -79,30 +79,30 @@ GoTofuEnv commands support the following environment variables.

String (Default: true)

If set to true gotofuenv will automatically install missing OpenTofu version needed (fallback to latest-allowed strategy when no [`.opentofu-version`](#opentofu-version-file) files are found).
If set to true tenv will automatically install missing OpenTofu version needed (fallback to latest-allowed strategy when no [`.opentofu-version`](#opentofu-version-file) files are found).

`tenv` subcommands `detect` and `use` support a `--no-install`, `-n` disabling flag version.

Example: use 1.6.0-rc1 version that is not installed, and auto installation is disabled. (-v flag is equivalent to `TOFUENV_VERBOSE=true`)

```console
$ TOFUENV_AUTO_INSTALL=false tenv use -v 1.6.0-rc1
Write 1.6.0-rc1 in /home/dvaumoron/.gotofuenv/.opentofu-version
Write 1.6.0-rc1 in /home/dvaumoron/.tenv/.opentofu-version
```

Example: use 1.6.0-rc1 version that is not installed, and auto installation stay enabled.

```console
$ tenv use -v 1.6.0-rc1
Installation of OpenTofu 1.6.0-rc1
Write 1.6.0-rc1 in /home/dvaumoron/.gotofuenv/.opentofu-version
Write 1.6.0-rc1 in /home/dvaumoron/.tenv/.opentofu-version
```

#### TOFUENV_FORCE_REMOTE (alias TFENV_FORCE_REMOTE)

String (Default: false)

If set to true gotofuenv detection of needed version will skip local check and verify compatibility on remote list.
If set to true tenv detection of needed version will skip local check and verify compatibility on remote list.

`tenv` subcommands `detect` and `use` support a `--force-remote`, `-f` flag version.

Expand Down Expand Up @@ -148,7 +148,7 @@ To install Terraform from a remote other than the default (must comply with [Has

#### TOFUENV_ROOT (alias TFENV_ROOT)

Path (Default: `$HOME/.gotofuenv`)
Path (Default: `$HOME/.tenv`)

The path to a directory where the local OpenTofu versions, Terraform versions and GoTofuEnv configuration files exist.

Expand Down Expand Up @@ -189,7 +189,7 @@ If not empty string, this variable overrides Terraform version, specified in `.t

String (Default: false)

Active the verbose display of gotofuenv.
Active the verbose display of tenv.

`tenv` support a `--verbose`, `-v` flag version.

Expand Down Expand Up @@ -249,7 +249,7 @@ List installed OpenTofu versions (located in TOFUENV_ROOT directory), sorted in
```console
$ tenv list
1.6.0-rc1
* 1.6.0 (set by /home/dvaumoron/.gotofuenv/.opentofu-version)
* 1.6.0 (set by /home/dvaumoron/.tenv/.opentofu-version)
```

### tenv list-remote
Expand Down Expand Up @@ -297,7 +297,7 @@ Flags:
-u, --remote-url string remote url to install from (default "https://releases.hashicorp.com/terraform")

Global Flags:
-r, --root-path string local path to install versions of OpenTofu and Terraform (default "/home/dvaumoron/.gotofuenv")
-r, --root-path string local path to install versions of OpenTofu and Terraform (default "/home/dvaumoron/.tenv")
-v, --verbose verbose output
```

Expand All @@ -324,13 +324,13 @@ Flags:
-w, --working-dir create .opentofu-version file in working directory

Global Flags:
-r, --root-path string local path to install versions of OpenTofu and Terraform (default "/home/dvaumoron/.gotofuenv")
-r, --root-path string local path to install versions of OpenTofu and Terraform (default "/home/dvaumoron/.tenv")
-v, --verbose verbose output
```

## .opentofu-version file

If you put a `.opentofu-version` file in working directory, user home directory or TOFUENV_ROOT directory, gotofuenv detects it and uses the version written in it.
If you put a `.opentofu-version` file in working directory, user home directory or TOFUENV_ROOT directory, tenv detects it and uses the version written in it.
Note, that TOFUENV_TOFU_VERSION can be used to override version specified by `.opentofu-version` file.

Recognized value (same as `tenv use` command) :
Expand Down
6 changes: 3 additions & 3 deletions cmd/tenv/subcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import (

"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/tofuutils/gotofuenv/config"
"github.com/tofuutils/gotofuenv/versionmanager"
"github.com/tofuutils/gotofuenv/versionmanager/semantic"
"github.com/tofuutils/tenv/config"
"github.com/tofuutils/tenv/versionmanager"
"github.com/tofuutils/tenv/versionmanager/semantic"
)

func newDetectCmd(conf *config.Config, versionManager versionmanager.VersionManager, params subCmdParams) *cobra.Command {
Expand Down
6 changes: 3 additions & 3 deletions cmd/tenv/tenv.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import (
"os"

"github.com/spf13/cobra"
"github.com/tofuutils/gotofuenv/config"
"github.com/tofuutils/gotofuenv/versionmanager"
"github.com/tofuutils/gotofuenv/versionmanager/builder"
"github.com/tofuutils/tenv/config"
"github.com/tofuutils/tenv/versionmanager"
"github.com/tofuutils/tenv/versionmanager/builder"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions cmd/terraform/terraform.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
package main

import (
"github.com/tofuutils/gotofuenv/versionmanager/builder"
"github.com/tofuutils/gotofuenv/versionmanager/proxy"
"github.com/tofuutils/tenv/versionmanager/builder"
"github.com/tofuutils/tenv/versionmanager/proxy"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions cmd/tofu/tofu.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
package main

import (
"github.com/tofuutils/gotofuenv/versionmanager/builder"
"github.com/tofuutils/gotofuenv/versionmanager/proxy"
"github.com/tofuutils/tenv/versionmanager/builder"
"github.com/tofuutils/tenv/versionmanager/proxy"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func InitConfigFromEnv() (Config, error) {

rootPath := getenvFallback(tofuRootPathEnvName, tfRootPathEnvName)
if rootPath == "" {
rootPath = path.Join(userPath, ".gotofuenv")
rootPath = path.Join(userPath, ".tenv")
}

verbose := false
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/tofuutils/gotofuenv
module github.com/tofuutils/tenv

go 1.21

Expand Down
2 changes: 1 addition & 1 deletion pkg/check/cosign/check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
_ "embed"
"testing"

cosigncheck "github.com/tofuutils/gotofuenv/pkg/check/cosign"
cosigncheck "github.com/tofuutils/tenv/pkg/check/cosign"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion pkg/check/pgp/check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
_ "embed"
"testing"

pgpcheck "github.com/tofuutils/gotofuenv/pkg/check/pgp"
pgpcheck "github.com/tofuutils/tenv/pkg/check/pgp"
)

//go:embed terraform_1.6.6_SHA256SUMS
Expand Down
4 changes: 2 additions & 2 deletions pkg/check/sha256/check_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright 2024 gotofuenv authors.
* Copyright 2024 tofuutils authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -22,7 +22,7 @@ import (
_ "embed"
"testing"

sha256check "github.com/tofuutils/gotofuenv/pkg/check/sha256"
sha256check "github.com/tofuutils/tenv/pkg/check/sha256"
)

//go:embed tofu_1.6.0_linux_arm64.zip
Expand Down
2 changes: 1 addition & 1 deletion pkg/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"strconv"
"strings"

"github.com/tofuutils/gotofuenv/pkg/apierrors"
"github.com/tofuutils/tenv/pkg/apierrors"
)

const pageQuery = "?page="
Expand Down
6 changes: 3 additions & 3 deletions pkg/github/github_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright 2024 gotofuenv authors.
* Copyright 2024 tofuutils authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -24,8 +24,8 @@ import (
"slices"
"testing"

"github.com/tofuutils/gotofuenv/pkg/apierrors"
"github.com/tofuutils/gotofuenv/versionmanager/semantic"
"github.com/tofuutils/tenv/pkg/apierrors"
"github.com/tofuutils/tenv/versionmanager/semantic"
)

// empty marker
Expand Down
4 changes: 2 additions & 2 deletions pkg/reversecmp/reverse_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright 2024 gotofuenv authors.
* Copyright 2024 tofuutils authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -22,7 +22,7 @@ import (
"cmp"
"testing"

"github.com/tofuutils/gotofuenv/pkg/reversecmp"
"github.com/tofuutils/tenv/pkg/reversecmp"
)

func TestReverserFalse(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions versionmanager/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
package builder

import (
"github.com/tofuutils/gotofuenv/config"
"github.com/tofuutils/gotofuenv/versionmanager"
terraformretriever "github.com/tofuutils/gotofuenv/versionmanager/retriever/terraform"
tofuretriever "github.com/tofuutils/gotofuenv/versionmanager/retriever/tofu"
"github.com/tofuutils/tenv/config"
"github.com/tofuutils/tenv/versionmanager"
terraformretriever "github.com/tofuutils/tenv/versionmanager/retriever/terraform"
tofuretriever "github.com/tofuutils/tenv/versionmanager/retriever/tofu"
)

func BuildTfManager(conf *config.Config) versionmanager.VersionManager {
Expand Down
8 changes: 4 additions & 4 deletions versionmanager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import (
"slices"

"github.com/hashicorp/go-version"
"github.com/tofuutils/gotofuenv/config"
"github.com/tofuutils/gotofuenv/pkg/reversecmp"
"github.com/tofuutils/gotofuenv/pkg/zip"
"github.com/tofuutils/gotofuenv/versionmanager/semantic"
"github.com/tofuutils/tenv/config"
"github.com/tofuutils/tenv/pkg/reversecmp"
"github.com/tofuutils/tenv/pkg/zip"
"github.com/tofuutils/tenv/versionmanager/semantic"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions versionmanager/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"os/exec"
"path"

"github.com/tofuutils/gotofuenv/config"
"github.com/tofuutils/gotofuenv/versionmanager"
"github.com/tofuutils/tenv/config"
"github.com/tofuutils/tenv/versionmanager"
)

func ExecProxy(builderFunc func(*config.Config) versionmanager.VersionManager, execName string) {
Expand Down
12 changes: 6 additions & 6 deletions versionmanager/retriever/terraform/terraformretriever.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ import (
"runtime"
"slices"

"github.com/tofuutils/gotofuenv/config"
"github.com/tofuutils/gotofuenv/pkg/apierrors"
pgpcheck "github.com/tofuutils/gotofuenv/pkg/check/pgp"
sha256check "github.com/tofuutils/gotofuenv/pkg/check/sha256"
"github.com/tofuutils/gotofuenv/pkg/download"
"github.com/tofuutils/gotofuenv/versionmanager/semantic"
"github.com/tofuutils/tenv/config"
"github.com/tofuutils/tenv/pkg/apierrors"
pgpcheck "github.com/tofuutils/tenv/pkg/check/pgp"
sha256check "github.com/tofuutils/tenv/pkg/check/sha256"
"github.com/tofuutils/tenv/pkg/download"
"github.com/tofuutils/tenv/versionmanager/semantic"
)

const publicKeyUrl = "https://www.hashicorp.com/.well-known/pgp-key.txt"
Expand Down
4 changes: 2 additions & 2 deletions versionmanager/retriever/terraform/terraformretriever_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright 2024 gotofuenv authors.
* Copyright 2024 tofuutils authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -24,7 +24,7 @@ import (
"slices"
"testing"

"github.com/tofuutils/gotofuenv/versionmanager/semantic"
"github.com/tofuutils/tenv/versionmanager/semantic"
)

//go:embed release.json
Expand Down
12 changes: 6 additions & 6 deletions versionmanager/retriever/tofu/tofuretriever.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ import (
"strings"

"github.com/hashicorp/go-version"
"github.com/tofuutils/gotofuenv/config"
cosigncheck "github.com/tofuutils/gotofuenv/pkg/check/cosign"
pgpcheck "github.com/tofuutils/gotofuenv/pkg/check/pgp"
sha256check "github.com/tofuutils/gotofuenv/pkg/check/sha256"
"github.com/tofuutils/gotofuenv/pkg/download"
"github.com/tofuutils/gotofuenv/pkg/github"
"github.com/tofuutils/tenv/config"
cosigncheck "github.com/tofuutils/tenv/pkg/check/cosign"
pgpcheck "github.com/tofuutils/tenv/pkg/check/pgp"
sha256check "github.com/tofuutils/tenv/pkg/check/sha256"
"github.com/tofuutils/tenv/pkg/download"
"github.com/tofuutils/tenv/pkg/github"
)

const publicKeyUrl = "https://get.opentofu.org/opentofu.asc"
Expand Down
2 changes: 1 addition & 1 deletion versionmanager/semantic/semantic.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"fmt"

"github.com/hashicorp/go-version"
"github.com/tofuutils/gotofuenv/versionmanager/semantic/tfparser"
"github.com/tofuutils/tenv/versionmanager/semantic/tfparser"
)

const (
Expand Down
Loading

0 comments on commit 0224299

Please sign in to comment.