Browse Source

Bug fixing

pull/103/head
Unknown 11 years ago
parent
commit
6f55d7e7ba
  1. 15
      cmd/bin.go
  2. 2
      gopm.go

15
cmd/bin.go

@ -99,7 +99,8 @@ func runBin(ctx *cli.Context) {
} }
// Check if previous steps were successful. // Check if previous steps were successful.
repoPath := installRepoPath + "/" + pkgPath + versionSuffix(ver) repoPath := strings.Replace(installRepoPath+"/"+pkgPath+versionSuffix(ver),
"\\", "/", -1)
if !com.IsDir(repoPath) { if !com.IsDir(repoPath) {
log.Error("bin", "Cannot continue command:") log.Error("bin", "Cannot continue command:")
log.Fatal("", "\tPrevious steps weren't successful") log.Fatal("", "\tPrevious steps weren't successful")
@ -161,11 +162,15 @@ func runBin(ctx *cli.Context) {
if ctx.Bool("dir") { if ctx.Bool("dir") {
movePath = ctx.Args()[1] movePath = ctx.Args()[1]
} }
err = os.Remove(movePath + "/" + binName)
if err != nil { if com.IsExist(movePath + "/" + binName) {
log.Warn("Cannot remove binary in work directory:") err = os.Remove(movePath + "/" + binName)
log.Warn("\t %s", err) if err != nil {
log.Warn("Cannot remove binary in work directory:")
log.Warn("\t %s", err)
}
} }
err = os.Rename(binName, movePath+"/"+binName) err = os.Rename(binName, movePath+"/"+binName)
if err != nil { if err != nil {
log.Error("bin", "Fail to move binary:") log.Error("bin", "Fail to move binary:")

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.5.7.1205.1" const APP_VER = "0.5.7.1205.2"
// //cmd.CmdSearch, // //cmd.CmdSearch,
// cmdClean, // cmdClean,

Loading…
Cancel
Save