Browse Source

Bug fixed in XP

pull/103/head
Unknown 11 years ago
parent
commit
44363c8499
  1. 4
      cmd/build.go
  2. 5
      log/log.go
  3. 4
      log/log_windows.go

4
cmd/build.go

@ -64,11 +64,15 @@ func runBuild(ctx *cli.Context) {
if isWindowsXP {
binName := pkgName + ".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)
if err != nil {
log.Error("Build", "Fail to move binary")
log.Fatal("", err.Error())
}
} else {
log.Warn("No binary generated")
}
}
log.Success("SUCC", "Build", "Command execute successfully!")

5
log/log.go

@ -36,6 +36,11 @@ func Fatal(hl, msg string) {
os.Exit(2)
}
func Warn(format string, args ...interface{}) {
fmt.Printf("gopm %s %s\n", brush.Purple("WARN"),
fmt.Sprintf(format, args...))
}
func Log(format string, args ...interface{}) {
fmt.Printf("gopm %s %s\n", brush.White("INFO"),
fmt.Sprintf(format, args...))

4
log/log_windows.go

@ -32,6 +32,10 @@ func Fatal(hl, msg string) {
os.Exit(2)
}
func Warn(format string, args ...interface{}) {
fmt.Printf("gopm WARN %s\n", fmt.Sprintf(format, args...))
}
func Log(format string, args ...interface{}) {
fmt.Printf("gopm INFO %s\n", fmt.Sprintf(format, args...))
}

Loading…
Cancel
Save