Browse Source

Bug fixed

pull/103/head
Unknown 11 years ago
parent
commit
e3761fa47f
  1. 2
      cmd/bin.go
  2. 13
      cmd/build.go
  3. 2
      cmd/gopath.go
  4. 1
      cmd/helper_windows.go

2
cmd/bin.go

@ -152,7 +152,7 @@ func runBin(ctx *cli.Context) {
if ctx.Bool("dir") {
movePath = ctx.Args()[1]
}
_, err = com.Move(binPath, movePath+"/"+binName)
err = os.Rename(binPath, movePath+"/"+binName)
if err != nil {
log.Error("Bin", "Fail to move binary")
log.Fatal("", err.Error())

13
cmd/build.go

@ -15,7 +15,8 @@
package cmd
import (
//"os"
"os"
"path"
"github.com/codegangsta/cli"
@ -47,5 +48,15 @@ func runBuild(ctx *cli.Context) {
log.Fatal("", err.Error())
}
if isWindowsXP {
binName := pkgName + ".exe"
os.Remove(binName)
err = os.Rename(path.Join(VENDOR, "src", pkgName, binName), binName)
if err != nil {
log.Error("Build", "Fail to move binary")
log.Fatal("", err.Error())
}
}
log.Success("SUCC", "Build", "Command execute successfully!")
}

2
cmd/gopath.go

@ -17,6 +17,8 @@ import (
const VENDOR = ".vendor"
var isWindowsXP = false
func getGopmPkgs(dirPath string, isTest bool) (pkgs map[string]*doc.Pkg, err error) {
absPath, err := filepath.Abs(dirPath)
if err != nil {

1
cmd/helper_windows.go

@ -16,6 +16,7 @@ func makeLink(srcPath, destPath string) error {
}
// XP.
isWindowsXP = true
os.RemoveAll(destPath)
return com.CopyDir(srcPath, destPath)
}

Loading…
Cancel
Save