diff --git a/cli/internal/cmd/miniup.go b/cli/internal/cmd/miniup.go index c4b469608..3adf8409c 100644 --- a/cli/internal/cmd/miniup.go +++ b/cli/internal/cmd/miniup.go @@ -206,11 +206,12 @@ func (m *miniUpCmd) prepareConfig(cmd *cobra.Command, fileHandler file.Handler) _, err = fileHandler.Stat(constants.ConfigFilename) if err == nil { // config already exists, prompt user to overwrite - cmd.PrintErrln("A config file already exists in the current workspace.") + cmd.PrintErrln("A config file already exists in the current workspace. Use --config to use an existing config file.") ok, err := askToConfirm(cmd, "Do you want to overwrite it?") if err != nil { return nil, err } + if !ok { return nil, errors.New("not overwriting existing config") } diff --git a/internal/config/validation.go b/internal/config/validation.go index e9cceb0dc..861b12602 100644 --- a/internal/config/validation.go +++ b/internal/config/validation.go @@ -370,11 +370,11 @@ func translateVersionCompatibilityError(ut ut.Translator, fe validator.FieldErro case errors.Is(err, compatibility.ErrSemVer): msg = fmt.Sprintf("configured version (%s) does not adhere to SemVer syntax", fe.Value().(string)) case errors.Is(err, compatibility.ErrMajorMismatch): - msg = fmt.Sprintf("the CLI's major version (%s) has to match your configured major version (%s)", constants.VersionInfo, fe.Value().(string)) + msg = fmt.Sprintf("the CLI's major version (%s) has to match your configured major version (%s). Use --force to ignore the version mismatch.", constants.VersionInfo, fe.Value().(string)) case errors.Is(err, compatibility.ErrMinorDrift): - msg = fmt.Sprintf("the CLI's minor version (%s) and the configured version (%s) are more than one minor version apart", constants.VersionInfo, fe.Value().(string)) + msg = fmt.Sprintf("the CLI's minor version (%s) and the configured version (%s) are more than one minor version apart. Use --force to ignore the version mismatch.", constants.VersionInfo, fe.Value().(string)) case errors.Is(err, compatibility.ErrOutdatedCLI): - msg = fmt.Sprintf("the CLI's version (%s) is older than the configured version (%s)", constants.VersionInfo, fe.Value().(string)) + msg = fmt.Sprintf("the CLI's version (%s) is older than the configured version (%s). Use --force to ignore the version mismatch.", constants.VersionInfo, fe.Value().(string)) default: msg = err.Error() }