From 511782dd774b0a10d59789973680e9a2fb38b875 Mon Sep 17 00:00:00 2001 From: lunny Date: Sat, 25 Jan 2014 15:00:31 +0800 Subject: [PATCH] bug fixed on windowsxp --- cmd/build.go | 9 ++++++--- gopm.go | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cmd/build.go b/cmd/build.go index 5461e586d..8e8cb68b2 100644 --- a/cmd/build.go +++ b/cmd/build.go @@ -17,6 +17,7 @@ package cmd import ( "os" "path" + "path/filepath" "github.com/Unknwon/com" "github.com/codegangsta/cli" @@ -68,10 +69,12 @@ func buildBinary(ctx *cli.Context, args ...string) { } if isWindowsXP { - binName := pkgName + ".exe" + fName := path.Base(pkgName) + binName := fName + ".exe" os.Remove(binName) - if com.IsFile(path.Join(doc.VENDOR, "src", pkgName, binName)) { - err = os.Rename(path.Join(doc.VENDOR, "src", pkgName, binName), binName) + exePath := filepath.Join(curPath, doc.VENDOR, "src", pkgName, binName) + if com.IsFile(exePath) { + err = os.Rename(exePath, filepath.Join(curPath, binName)) if err != nil { log.Error("build", "fail to move binary:") log.Fatal("", "\t"+err.Error()) diff --git a/gopm.go b/gopm.go index eeef579ec..bb45dc884 100644 --- a/gopm.go +++ b/gopm.go @@ -29,7 +29,7 @@ import ( // Test that go1.1 tag above is included in builds. main.go refers to this definition. const go11tag = true -const APP_VER = "0.6.2.0115" +const APP_VER = "0.6.2.0125" // //cmd.CmdSearch, // cmdClean,