From 2f5c185708fdade6f035d0428edc312fff9f9789 Mon Sep 17 00:00:00 2001 From: sophia Date: Thu, 28 Jul 2022 11:12:01 -0500 Subject: [PATCH] Warn users when using vagrant-go --- internal/cli/base.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/internal/cli/base.go b/internal/cli/base.go index 9d9070f9d..eb279f76c 100644 --- a/internal/cli/base.go +++ b/internal/cli/base.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "io" + "os" "regexp" "strconv" "strings" @@ -187,6 +188,22 @@ func BaseCommand(ctx context.Context, log hclog.Logger, logOutput io.Writer, opt } bc.ui = ui + outputExperimentalWarning := true + if val, ok := os.LookupEnv("VAGRANT_SUPPRESS_GO_EXPERIMENTAL_WARNING"); ok { + if v, err := strconv.ParseBool(val); err == nil && v { + outputExperimentalWarning = false + } + } + if outputExperimentalWarning { + ui.Output(` +This is an experimental version of Vagrant. Please note that some things may +not work as you expect and this version of Vagrant is not compatible with the +stable version of Vagrant. For more information about vagrant-go read the docs +at https://www.vagrantup.com/docs/experimental/vagrant_go. To disable this +warning set the environment variable 'VAGRANT_SUPPRESS_GO_EXPERIMENTAL_WARNING'. +`) + } + homeConfigPath, err := paths.NamedVagrantConfig(bc.flagBasis) if err != nil { return nil, err