From e23253bc232edd30302dbbbfe6386ece605c552e Mon Sep 17 00:00:00 2001 From: astaxie Date: Sat, 9 May 2015 18:20:08 +0800 Subject: [PATCH] fix #99 --- new.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/new.go b/new.go index 2b3305e..3f6a952 100644 --- a/new.go +++ b/new.go @@ -100,9 +100,12 @@ func createApp(cmd *Command, args []string) int { apppath := path.Join(curpath, args[0]) - if _, err := os.Stat(apppath); os.IsNotExist(err) == false { - fmt.Printf("[ERRO] Path (%s) already exists\n", apppath) - os.Exit(2) + if isExist(apppath) { + ColorLog("[ERRO] Path (%s) already exists\n", apppath) + ColorLog("[WARN] Do you want to overwrite it? [yes|no]]") + if !askForConfirmation() { + os.Exit(2) + } } fmt.Println("[INFO] Creating application...")