From 2d7d241ed38137b594e66298fe1df17e86971013 Mon Sep 17 00:00:00 2001 From: Bruno Michel Date: Thu, 28 Dec 2017 13:45:45 +0100 Subject: [PATCH] Ask domain to confirm an instance destroy --- cmd/instances.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/instances.go b/cmd/instances.go index 3d68dd119c0..d9326e65ffe 100644 --- a/cmd/instances.go +++ b/cmd/instances.go @@ -284,9 +284,9 @@ and all its data. if !flagForce { reader := bufio.NewReader(os.Stdin) - fmt.Printf(`Are you sure you want to remove instance for domain %s ? + fmt.Printf(`Are you sure you want to remove instance for domain %s? All data associated with this domain will be permanently lost. -[yes/NO]: `, domain) +Type again the domain to confirm: `, domain) str, err := reader.ReadString('\n') if err != nil { @@ -294,8 +294,8 @@ All data associated with this domain will be permanently lost. } str = strings.ToLower(strings.TrimSpace(str)) - if str != "yes" && str != "y" { - return nil + if str != domain { + return errors.New("Aborted") } fmt.Println()