Browse Source

bug fixed on windowsxp

pull/103/head
lunny 11 years ago
parent
commit
511782dd77
  1. 9
      cmd/build.go
  2. 2
      gopm.go

9
cmd/build.go

@ -17,6 +17,7 @@ package cmd
import ( import (
"os" "os"
"path" "path"
"path/filepath"
"github.com/Unknwon/com" "github.com/Unknwon/com"
"github.com/codegangsta/cli" "github.com/codegangsta/cli"
@ -68,10 +69,12 @@ func buildBinary(ctx *cli.Context, args ...string) {
} }
if isWindowsXP { if isWindowsXP {
binName := pkgName + ".exe" fName := path.Base(pkgName)
binName := fName + ".exe"
os.Remove(binName) os.Remove(binName)
if com.IsFile(path.Join(doc.VENDOR, "src", pkgName, binName)) { exePath := filepath.Join(curPath, doc.VENDOR, "src", pkgName, binName)
err = os.Rename(path.Join(doc.VENDOR, "src", pkgName, binName), binName) if com.IsFile(exePath) {
err = os.Rename(exePath, filepath.Join(curPath, binName))
if err != nil { if err != nil {
log.Error("build", "fail to move binary:") log.Error("build", "fail to move binary:")
log.Fatal("", "\t"+err.Error()) log.Fatal("", "\t"+err.Error())

2
gopm.go

@ -29,7 +29,7 @@ import (
// Test that go1.1 tag above is included in builds. main.go refers to this definition. // Test that go1.1 tag above is included in builds. main.go refers to this definition.
const go11tag = true const go11tag = true
const APP_VER = "0.6.2.0115" const APP_VER = "0.6.2.0125"
// //cmd.CmdSearch, // //cmd.CmdSearch,
// cmdClean, // cmdClean,

Loading…
Cancel
Save