From bc40cfb334502d89dd7b09f4b23d8dadda0ad640 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sun, 19 May 2013 19:54:06 -0400 Subject: [PATCH] update --- build.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/build.go b/build.go index afd196f41..61cd986d5 100644 --- a/build.go +++ b/build.go @@ -41,12 +41,14 @@ func runBuild(cmd *Command, args []string) { for _, v := range paths { if utils.IsExist(v + "/bin/" + proName) { - err := os.Remove(wd + "/" + proName) - if err != nil { - fmt.Printf("Fail to remove file in current directory: %s.\n", err) - return + if utils.IsExist(wd + "/" + proName) { + err := os.Remove(wd + "/" + proName) + if err != nil { + fmt.Printf("Fail to remove file in current directory: %s.\n", err) + return + } } - err = os.Rename(v+"/bin/"+proName, wd+"/"+proName) + err := os.Rename(v+"/bin/"+proName, wd+"/"+proName) if err == nil { fmt.Printf("Moved file from $GOPATH(%s) to current directory(%s).\n", v, wd) return