diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 2a05b374..840b99c0 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -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: @@ -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: @@ -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: @@ -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 }}" diff --git a/README.md b/README.md index e44d717c..ceba0dbf 100644 --- a/README.md +++ b/README.md @@ -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 : @@ -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. @@ -79,7 +79,7 @@ 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. @@ -87,7 +87,7 @@ Example: use 1.6.0-rc1 version that is not installed, and auto installation is d ```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. @@ -95,14 +95,14 @@ Example: use 1.6.0-rc1 version that is not installed, and auto installation stay ```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. @@ -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. @@ -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. @@ -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 @@ -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 ``` @@ -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) : diff --git a/cmd/tenv/subcmd.go b/cmd/tenv/subcmd.go index 7521f7b4..4ad9e38e 100644 --- a/cmd/tenv/subcmd.go +++ b/cmd/tenv/subcmd.go @@ -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 { diff --git a/cmd/tenv/tenv.go b/cmd/tenv/tenv.go index 28c20a0d..5040898f 100644 --- a/cmd/tenv/tenv.go +++ b/cmd/tenv/tenv.go @@ -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 ( diff --git a/cmd/terraform/terraform.go b/cmd/terraform/terraform.go index 690ec2e8..053efcfe 100644 --- a/cmd/terraform/terraform.go +++ b/cmd/terraform/terraform.go @@ -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() { diff --git a/cmd/tofu/tofu.go b/cmd/tofu/tofu.go index a99a6936..d4624499 100644 --- a/cmd/tofu/tofu.go +++ b/cmd/tofu/tofu.go @@ -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() { diff --git a/config/config.go b/config/config.go index faa7c34d..a4d499a4 100644 --- a/config/config.go +++ b/config/config.go @@ -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 diff --git a/go.mod b/go.mod index abfb5192..08728295 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/tofuutils/gotofuenv +module github.com/tofuutils/tenv go 1.21 diff --git a/pkg/check/cosign/check_test.go b/pkg/check/cosign/check_test.go index 4d05a2d9..ce897fb9 100644 --- a/pkg/check/cosign/check_test.go +++ b/pkg/check/cosign/check_test.go @@ -22,7 +22,7 @@ import ( _ "embed" "testing" - cosigncheck "github.com/tofuutils/gotofuenv/pkg/check/cosign" + cosigncheck "github.com/tofuutils/tenv/pkg/check/cosign" ) const ( diff --git a/pkg/check/pgp/check_test.go b/pkg/check/pgp/check_test.go index e17ff371..65252be8 100644 --- a/pkg/check/pgp/check_test.go +++ b/pkg/check/pgp/check_test.go @@ -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 diff --git a/pkg/check/sha256/check_test.go b/pkg/check/sha256/check_test.go index 8890fa3f..d6e10d76 100644 --- a/pkg/check/sha256/check_test.go +++ b/pkg/check/sha256/check_test.go @@ -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. @@ -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 diff --git a/pkg/github/github.go b/pkg/github/github.go index a87b85af..3dafac80 100644 --- a/pkg/github/github.go +++ b/pkg/github/github.go @@ -27,7 +27,7 @@ import ( "strconv" "strings" - "github.com/tofuutils/gotofuenv/pkg/apierrors" + "github.com/tofuutils/tenv/pkg/apierrors" ) const pageQuery = "?page=" diff --git a/pkg/github/github_test.go b/pkg/github/github_test.go index 1cee706c..d9950aab 100644 --- a/pkg/github/github_test.go +++ b/pkg/github/github_test.go @@ -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. @@ -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 diff --git a/pkg/reversecmp/reverse_test.go b/pkg/reversecmp/reverse_test.go index 9dd20bf9..c3a3e203 100644 --- a/pkg/reversecmp/reverse_test.go +++ b/pkg/reversecmp/reverse_test.go @@ -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. @@ -22,7 +22,7 @@ import ( "cmp" "testing" - "github.com/tofuutils/gotofuenv/pkg/reversecmp" + "github.com/tofuutils/tenv/pkg/reversecmp" ) func TestReverserFalse(t *testing.T) { diff --git a/versionmanager/builder/builder.go b/versionmanager/builder/builder.go index cc46f92f..5d7e25c5 100644 --- a/versionmanager/builder/builder.go +++ b/versionmanager/builder/builder.go @@ -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 { diff --git a/versionmanager/manager.go b/versionmanager/manager.go index 415ff4f7..ff39aa68 100644 --- a/versionmanager/manager.go +++ b/versionmanager/manager.go @@ -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 ( diff --git a/versionmanager/proxy/proxy.go b/versionmanager/proxy/proxy.go index 158d5ed4..e78d4b4f 100644 --- a/versionmanager/proxy/proxy.go +++ b/versionmanager/proxy/proxy.go @@ -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) { diff --git a/versionmanager/retriever/terraform/terraformretriever.go b/versionmanager/retriever/terraform/terraformretriever.go index 62b3a3a9..d9aa887c 100644 --- a/versionmanager/retriever/terraform/terraformretriever.go +++ b/versionmanager/retriever/terraform/terraformretriever.go @@ -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" diff --git a/versionmanager/retriever/terraform/terraformretriever_test.go b/versionmanager/retriever/terraform/terraformretriever_test.go index ec95941d..7671bb75 100644 --- a/versionmanager/retriever/terraform/terraformretriever_test.go +++ b/versionmanager/retriever/terraform/terraformretriever_test.go @@ -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. @@ -24,7 +24,7 @@ import ( "slices" "testing" - "github.com/tofuutils/gotofuenv/versionmanager/semantic" + "github.com/tofuutils/tenv/versionmanager/semantic" ) //go:embed release.json diff --git a/versionmanager/retriever/tofu/tofuretriever.go b/versionmanager/retriever/tofu/tofuretriever.go index 1b204dff..5b28de4d 100644 --- a/versionmanager/retriever/tofu/tofuretriever.go +++ b/versionmanager/retriever/tofu/tofuretriever.go @@ -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" diff --git a/versionmanager/semantic/semantic.go b/versionmanager/semantic/semantic.go index e5b77d94..773626b1 100644 --- a/versionmanager/semantic/semantic.go +++ b/versionmanager/semantic/semantic.go @@ -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 ( diff --git a/versionmanager/semantic/semantic_test.go b/versionmanager/semantic/semantic_test.go index 8f3c4989..d72cfc1f 100644 --- a/versionmanager/semantic/semantic_test.go +++ b/versionmanager/semantic/semantic_test.go @@ -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. @@ -22,7 +22,7 @@ import ( "slices" "testing" - "github.com/tofuutils/gotofuenv/versionmanager/semantic" + "github.com/tofuutils/tenv/versionmanager/semantic" ) func TestCmpVersion(t *testing.T) {